-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make auto-margin step dependent on axis label span #296
Comments
There's no automated way to do that at the moment. Making the Renaming this issue accordingly. |
+1 from me too |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
Little workarround: You can calculate the needed margins for your layout out of the SVG:
The Plot will "jump" on pageload, but the legends should be in place. Use the function with:
Please also let me know if it worked for you and or your improvement suggestions! Thanks. |
If someone needs it for Plotly 1.17.2:
|
+1. Without a fix for this, a lot of the formatting and styling options are unusable. |
Workaround is by no means the solution, i agree. I'm just waiting for this already for half a year and used plotly on production site. It's more a desperate try to satisfy my customers and thought, one of you could maybe need it. |
+1 |
2 similar comments
+1 |
+1 |
I gave it try to make a fix. My change helped a bit on couple of my simple test cases, for example. The code changes are only a proof of concept: hy9be@5f5ad4f It would be great if @etpinard or any other admins could take a look and give some feedback to me. |
And I do not 100% sure about what the 3rd parameters of |
That's the starting position in normalized plot coordinates (i.e. the same coordinate system we use to position e.g. legend) |
Hey @hy9be - do you need any more help, suggestions, or feedback with this one? This looks promising! |
Hi @jackparmer I'm following @hy9be 's fix. would you be able to explain more about the "x", "y" here? Could you explain more details about the normalized plot coordinates? I'm asking because I have trouble understanding the algorithm in plots.doAutoMargin. BTW: According to my investigation, this is also a promising fix for #1504 |
@jackparmer I did not get a chance to making further progress as I have similar confusion with @bewaiting4, about what "x" and "y" stands for in the Also if any one could add some comments for the core algorithm in |
+1 |
2 similar comments
+1 |
+1 |
I'm getting a little tired of those _+1_s. Locking this conversion until we start working on this (which should happen soon). |
I'm happy to report that this is now fixed, with the addition of the Some caveats: this doesn't interact with the legend's positioning, so tick labels can still conflict there, and for x-axes at the top, can conflict with the plot title, but it's a good start! Here's the mock that shows it in action: https://github.com/plotly/plotly.js/blob/master/test/image/baselines/long_axis_labels.png |
Nice. |
Nop. |
Unfortunately it just works for 2d cartesian axes at the moment. |
May I open a new issue for pie charts? |
@etpinard @nicolaskruchten I bet you guys thought you were done with this. 😜 |
Yep, we should probably 🔒 this thing again 😛 |
I'm happy to field some comments here for a while :) @fcasarramona please do create a new issue for whatever else you need... we won't track any additional work on this issue. |
It already exists the issue for pie charts since Dec, 2015, 😛 "Pie charts don't always seem to fit labels to a constrained space" #75 |
Long tick labels still getting cut off - Automargin functionality for Python not working.
|
Hi @soerendip ! If you're encountering automargin issues in Python, please create an issue in the Plotly.py repo and we'll take a look :) https://github.com/plotly/plotly.py/issues/new |
Hi there, I have some graphs with particularly long labels/axis string values and I'm wondering if there's a way to get them to fit without changing the
layout.margin
option because I'm using dynamic data.Here's CodePen showing a longer label being cut off on both a vertically and horizontally-oriented bar chart - http://codepen.io/mnoble01/pen/zqxZQx.
The text was updated successfully, but these errors were encountered: