From: Ted D. <ted...@jp...> - 2005-07-22 20:41:55
|
The legend() docs state: Make a legend with existing lines >>> legend() legend by itself will try and build a legend using the label property of the lines/patches/collections. You can set the label of a line by doing plot(x, y, label='my data') or line.set_label('my data'). If label is set to '_nolegend_', the item will not be shown in legend. But trying to pass '_nolegend_' doesn't seem to work. And a grep through the code finds no instances of '_nolegend_'. import pylab as p x = p.arange( 0,3, .1 ) y1 = p.cos( x ) y2 = p.sin( x ) y3 = 2*p.sin( x ) p.plot( x, y1 ) p.plot( x, y2 ) p.plot( x, y3 ) p.legend( ( "cos(x)", "_nolegend_", "2*sin(x)" ) ) p.show() |