Hi,
I am unable to create legend for vlines graph. I have modified the
vline_demo.py to demonstrate the problem (see below)
------------------------------------------------------------
#!/usr/bin/env python
from matplotlib.pyplot import *
from numpy import sin, exp, absolute, pi, arange
from numpy.random import normal
def f(t):
s1 = sin(2*pi*t)
e1 = exp(-t)
return absolute((s1*e1))+.05
t = arange(0.0, 5.0, 0.1)
s = f(t)
nse = normal(0.0, 0.3, t.shape) * s
#plot(t, s+nse, 'b^')
vlines(t, [0], s, label='vline demo')
##Legend creation addedin the demo
legend()
##Legend creation addedin the demo
xlabel('time (s)')
title('Comparison of model with data')
show()
------------------------------------------------------------
I am getting following error stack
## File "\ActivePython25\Lib\site-packages\matplotlib\figure.py", line 772, in
draw
## for a in self.axes: a.draw(renderer)
## File "\ActivePython25\Lib\site-packages\matplotlib\axes.py", line 1601, in
draw
## a.draw(renderer)
## File "\ACTIVE~1\lib\site-packages\matplotlib\legend.py", line 316, in draw
## self._update_legend_box(renderer)
## File "\ACTIVE~1\lib\site-packages\matplotlib\legend.py", line 626, in
_update_legend_box
## legline_marker = legline._legmarker
##AttributeError: 'Line2D' object has no attribute '_legmarker'
Do I have to do something specific to get the legend for vlines graph ?
regards,
Nitin
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users