Re: Adding Legends to Coyote Graphics Windows [message #86864 is a reply to message #86863] |
Mon, 09 December 2013 06:07   |
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?
Yes, there is a "chance" I will do something like this. I usually wait
for people to ask for more complicated things, but I usually wait more
than two minutes. ;-)
> Specifying the coordinates of the upper left hand corner of the legend box seems tricky if you want the legend to go in any other corner of the plot than upper left, given that you may want to add or remove items of various lengths. Or is there a smart way if thinking about this that I just don't see?
Here is the problem. It is impossible to know what size the legend is
going to be until it is drawn. AL_Legend and cgLegend both solve the
problem in the same way: they draw the legend twice, the second time
overwriting the first. I had hoped to be able to do this a different
way, and I wrote code to do so, but I haven't been able to make it work
correctly in the PostScript device yet.
Of course, as I am writing this I am thinking of another way it might be
implemented. So, yes, there is a "chance". But, why would you choose
cgLegend over AL_Legend if they both did the same thing?
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.")
|
|
|