[SciPy-user] plot vertical lines

Afi Welbeck welby555 at yahoo.com
Mon Jul 13 09:32:56 EDT 2009


Hi,
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 at gmail.com>
To: SciPy Users List <scipy-user at scipy.org>
Sent: Monday, July 13, 2009 2:31:17 PM
Subject: Re: [SciPy-user] plot vertical lines

2009/7/13 Afi Welbeck <welby555 at 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])
plt.show()

Hoping that helps,

Angus.
-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
_______________________________________________
SciPy-user mailing list
SciPy-user at scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user



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


More information about the SciPy-User mailing list