|
From: Bill B. <wb...@gm...> - 2007-04-13 08:44:15
|
There are a couple things about legend that I'm finding a little
irksome. Is there some better way to do this?
1) if you have a contour, legend() wants to add all the contours to
the list. calling contour(...,label='_nolegend_') doesn't seem to
help.
I'm trying to plot a bunch of different types of markers on top of a
contour plot, and put just the markers in the legend. The workaround
seems to be
contour(. . . )
p1 = plot( . . .)
p2 = plot(. . .)
. . .
pN = plot(. . .)
legend((p1,p2,...,pN), ('Legend1', 'Legend2', ... , 'LegendN'))
Basically I have to save the plot data and repeat myself later.
2) The '_nolegend_' trick doesn't work for things in the simple call
style for legend()
legend('_nolegend_', 'Data 1', 'Data 2')
That makes a legend containing the string "_nolegend_".
My first hunch to do that before looking at the docs at all was to put
in a None for a legend I wanted to leave off. That's raises an error
though. Might be nice if it was made a legal way to omit something
from the legend.
--bb
|