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.