On Sunday, December 2, 2018 at 7:10:36 AM UTC+8, Matt Jadud wrote:
>
> Thanks for the pointer; I should have searched the group history before 
> asking. And, perhaps, the ticket queue.
>
> For what I'm exploring right now, that would be just fine, and makes 
> perfect sense, and will let me proceed with explorations without (yet) 
> making pull requests. 
>
> However, I personally feel like the enhancement that Ben pointed to is a 
> good one.
>

The enhancement is indeed a good one, but the implementation it is not
trivial.  The problem is that there is no "outer area" in the plot where to
put the legend in.  When the plot library allocates space for the different
plot elements (labels, axes, plot area, etc), it does not consider the 
legend,
but instead it assumes that it will be placed somewhere inside the plot 
area.
This means that, before an anchor such as 'outer-upper-right can be 
translated
into x,y coordinates for the drawing, the code will need to be updated to
make room for the legend if it needs to be outside the plot area.

I know roughly what needs to be done, and I can point you in the right
direction, if you are interested, but I don't have time to make these 
changes
myself.

The linked enhancement request, https://github.com/racket/plot/issues/49,
proposes a different approach, where the plot functions would return two
pictures, one for the plot itself and another for the plot legend, with the
expectation that the user will combine them.  This is somewhat similar to 
what
I showed in my example, except my code constructed the legend "manually" and
therefore might get out of sync with the plot data.

Implementing this approach would not be any simpler, in my opinion, and it
will involve a bigger API change.

Alex.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to