Open mzechmeister opened 1 year ago
Is positioning it like this OK?
https://jsfiddle.net/f9mxnras/4/
Just adding side:'top'
to legend.title
makes the automatic placement acceptable
@28raining I want to put the legend below the graph (not inside).
This then? https://jsfiddle.net/L519hxk4/
In your original post you said you had to guess. That's correct, plotly team decided to use X, Y, Xanchor and Yanchor to position the title... not text like 'below' or 'middle'
Now you use side: 'top'
and y=-1
yielding a rather large gap towards the axis label. You see it's guessing and not fully clear what will happen, if the graph is resized or font size changes. And the default as shown above is unpleasent, too.
I think, what is missing, might be to specify y
in terms of char heights or an additional coordinate system (graph, screen), which refers to the outer border. (There is a xref = ‘paper’
, but seems to be just relative graph coordinates).
Are you requesting feature; instead of writing Y=-0.2
, it's possible to write Y=-2*char
?
Because I think the Y=-0.2 solution works perfectly, I won't be working on this. Feel free to git clone and create a PR to add this feature.
So, yeah if there is no convenient solution, it seems I'm requesting a feature and leave it the experts familiar with code.
I want to put a (long) legend horizontally and below the xaxis.
But I have some trouble with positioning.
y
(or are the better ways?https://jsfiddle.net/5udmbkza