Re: Adding Legends to Coyote Graphics Windows [message #86878 is a reply to message #86863] |
Mon, 09 December 2013 14:10   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mats Löfdahl writes:
> I have found that with al_legend, I almost always use the top/bottom and left/right keywords for placement. Any chance you will implement them in cglegend?
I have added functionality to cgLegend that will make this slightly more
flexible than AL_Legend, I think. Here is how it works.
There is an ALIGNMENT keyword that can be used to change the meaning of
the LOCATION keyword. (The LOCATION keyword is called POSITION in
AL_Legend, but I use POSITION to mean a particular four-element array in
Coyote Graphics, so I changed this keyword name.) Basically, with the
ALIGNMENT keyword you can specify whether the LOCATION is any of the
four corners of the legend "box", or the middle of any of the four sides
of the legend "box". You have eight choices.
This allows you to put the legend anywhere you like in the plot window
(including outside the plot, if you want to). You can center the legend
box both horizontally and vertically. Or, you can left, right, top, and
bottom align it. You simply specify a point location, and tell me, with
the ALIGNMENT keyword, what part of the box should be aligned with that
point.
You will need two files:
http://www.idlcoyote.com/programs/cglegend.pro
http://www.idlcoyote.com/programs/cglegenditem.pro
You can find documentation on the program and on the ALIGNMENT keyword
here:
http://www.idlcoyote.com/idldoc/cg/cglegend.html
Hours spent updating cgLegend for better legend positioning: 8 hours.
Income from newsgroup requested activities for December: $60.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|