comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » FG Bug -- Legend/Cleanup
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: FG Bug -- Legend/Cleanup [message #90492 is a reply to message #90484] Thu, 05 March 2015 06:55 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On Wednesday, March 4, 2015 at 11:02:26 PM UTC+1, Matthew Argall wrote:
> Another bug:
>
> I was working with sample data that resulted in a single-point average with standard deviation. I tried to create an error plot with a legend and got an error
>
> win = window()
> p1 = plot(/TEST, /CURRENT, LAYOUT=[1,2,1], NAME='Plot')
>
> y = [5.0]
> yerror = [0.329]
> x = [1.0]
> p2 = errorplot(x, y, yerror, LAYOUT=[1,2,2], NAME='ErrorPlot 2', /CURRENT, SYMBOL='Diamond', XRANGE=[0,2], YRANGE=[0,10])
> leg1 = legend(TARGET=p1, LABEL='Plot X', TEXT_COLOR='Black')
> leg1 -> Add, p2, LABEL='Plot Y', TEXT_COLOR='Blue'
> % Variable is undefined: ONEWLEGENDITEMS.
> % Execution halted at: $MAIN$

I am not sure this is a bug.
If you call LEGEND this way:
leg1 = legend(TARGET=[p1,p2])
you can eventually force the labels by:
leg1[0].label = 'PLOT X'
leg1[1].label = 'PLOT Y'
Even better would be to initialize NAME in both plot calls accordingly.
alx.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Passing string from IDL to Fortran
Next Topic: Using 1D FFT to decompose the provided hurricane data in terms of wavenumbers.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 07:05:57 PDT 2025

Total time taken to generate the page: 0.63831 seconds