[SciPy-user] plot vertical lines

Afi Welbeck welby555@yahoo....
Mon Jul 13 08:32:56 CDT 2009

Thanks it worked.
But I observed that for the values I gave you,
you altered them a bit before it plotted it just 
they way I expected. Is there some formula
for this sort of plot?

From: Angus McMorland <amcmorl@gmail.com>
To: SciPy Users List <scipy-user@scipy.org>
Sent: Monday, July 13, 2009 2:31:17 PM
Subject: Re: [SciPy-user] plot vertical lines

2009/7/13 Afi Welbeck <welby555@yahoo.com>:
> Hi,
> I'm a newbie. I'm stuck trying to link the following
> points with vertical lines in the xy plane
> (1,1) (1,4)  and (3,2) (3,6)
> Could anyone please help me with the code?

Here's an verbose way to do it, so you can see what's going on. You'll
need matplotlib installed for this, and it's the generally recommended
2-d graphics package to accompany scipy.

import matplotlib.pyplot as plt
x0 = [1,1]
y0 = [1,4]
x1 = [3,3]
y1 = [2,6]
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x0, y0, x1, y1)
ax.set_xlim([0, 4])
ax.set_ylim([0, 7])

Hoping that helps,

AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
SciPy-user mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20090713/5f05c862/attachment-0001.html 

More information about the SciPy-user mailing list