The IDLgrLegend::Remove procedure method removes a legend item from the legend.
Syntax
Obj->[IDLgrLegend::]Remove [, Items] [, /ALL]
Arguments
Items
A single item, an array of items, or a list of items to be removed from the legend. An item can be a graphic reference or a graphic name.
Keywords
ALL
Set this keyword to remove all legend items from the legend.
Example
sinewave = SIN( 2.0 * FINDGEN(200) * !PI / 25.0) * EXP(-0.2 * FINDGEN(200))
p1 = PLOT(sinewave, NAME='Plot 1')
p2 = PLOT(sinewave/2, NAME='Plot 2', COLOR='red', /OVERPLOT)
p3 = PLOT(sinewave/4, NAME='Plot 3', COLOR='green', /OVERPLOT)
p4 = PLOT(sinewave/6, NAME='Plot 4', COLOR='blue', /OVERPLOT)
l = LEGEND()
l.Remove, p2
l.Remove, ['Plot 1', 'Plot 4']
Version History