[SciPy-user] plot vertical lines

Fabrice Silva silva at lma.cnrs-mrs.fr
Mon Jul 13 08:47:40 EDT 2009


Le lundi 13 juillet 2009 à 08:31 -0400, Angus McMorland a écrit :
> 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?

I was suggesting:
plt.axvline(1, ymin=1, ymax=4, trans=plt.gca().transData)
plt.axvline(3, ymin=2, ymax=6, trans=plt.gca().transData)

when I got the following message :
TypeError: type object got multiple values for keyword argument
'transform'

In fact, despite the doc tells axvline accepts the transform keyworg
argument, there is no special handling of this kwarg in axvline code (in
0.98.5.3). There is a problem since axvline code (and axhline and
ax*span too I suppose) add a transform kwarg before adding the line to
the axes...
-- 
Fabrice Silva
Laboratory of Mechanics and Acoustics - CNRS
31 chemin Joseph Aiguier, 13402 Marseille, France.




More information about the SciPy-User mailing list