lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

Make the legend_justification parameter more flexible

Open ASmirnov-HORIS opened this issue 1 year ago • 2 comments

Currently, the only available string value for legend_justification is 'centre'. But it would also be useful to be able to set 'top', 'bottom', 'left' and 'right'.

For example, in ggplot2, such plot could easily be obtained with legend.position = 'top' and legend.justification = 'right':

In Lets-Plot, to achieve the same, you have to use a fine-tuned combination of parameters like legend_position=[.8, 1], legend_justification=[0, 1], legend_direction='horizontal' and, in addition, move the panel down, otherwise the legend will be drawn on top of it:

ASmirnov-HORIS avatar Feb 26 '24 17:02 ASmirnov-HORIS

But it seems you are talking about different cases: in your ggplot2 example the legend is ontop and outside of the "geom area". However, in lets-plot example the legend is inside the "geom area" in top-right corner.

alshan avatar Feb 26 '24 18:02 alshan

I apologise if I wasn't clear.

The only thing I want in this issue is to be able to set string values other than 'center' for legend_justification (namely: 'left', 'right', 'top' and 'bottom').

ASmirnov-HORIS avatar Feb 28 '24 16:02 ASmirnov-HORIS