Re: Adding Legends to Coyote Graphics Windows [message #86868 is a reply to message #86864] |
Mon, 09 December 2013 07:10   |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den måndagen den 9:e december 2013 kl. 15:07:58 UTC+1 skrev David Fanning:
> 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. ;-)
Not complicated enough? OK, what about automatically figuring out where there is empty space in the plot and put the legend there? :o)
>> 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.
I realize that something like that has to go on behind the scene. What I meant was that I didn't know of a smart way to figure this out as a user.
> 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?
They are solving the same problem, so there's bound to be some overlap. The placement keywords are overlap that I would like to see but that doesn't mean I don't think you will make cgLegend smarter than AL_Legend in many other respects.
|
|
|