IDL astrolib - al_legend not plotting anything

57 views
Skip to first unread message

Bruce Macintosh

unread,
Jan 28, 2021, 2:30:28 PM1/28/21
to idl-pvwave
Hi everybody - newly joined the group, long-term IDL user. Just did a new IDL installation (8.8.0) on a newish Macbook running Catalina (10.15.7), with a new installation of the IDL astro library. 

One thing that isn't working the way I think it should is the al_legend program - the renamed version of the astro "legend" to put legends on plots. It seems to be defaulting to drawing its text in black rather than in !P.COLOR, and seems to do this in both decomposed and non-decomposed mode (though I haven't tested extensively.) Worked in an older installation (IDL7ish) but I'm not sure if the issue is in the astrolib, the Coyote libraries (which astrolib uses), or the new IDL version. Thoughts? 

Wayne Landsman

unread,
Jan 29, 2021, 11:25:37 AM1/29/21
to idl-pvwave
Actually, AL_LEGEND defaults to drawing text in "Opposite", meaning opposite of the background color.    For Coyote graphics and IDL function graphics (and postscript) this defaults to drawing black on a white background.           The Coyote routines try to read a corner of the current window to determine the background color, but apparently this is not always successful (and a big source of headaches for David Fanning).

I would use the textcolor keyword to specify what color you want to the text to be (e.g. textcolor = 'red').       You can also specify the background_color.

I would not use !p.color to specify a color, which only made sense in the days of 8 bit color. 

Bruce Macintosh

unread,
Feb 5, 2021, 6:43:52 PM2/5/21
to idl-pvwave

Thank you - much appreciated!
Reply all
Reply to author
Forward
0 new messages