-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
How to align ticks for multiple y axis so all grid squares are equal size #1962
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
Comments
You can make this happen manually (set I suppose it would be possible to add a setting like Another solution you may be interested in is turning the gridlines off and using |
Any update on this issue? Is there any workaround or hacky solution? |
No updates, and the only workarounds I'm aware of are those I mentioned above. This would be a great issue for a community PR. |
@ankuradhey If this is a deal breaker then you may want to try out Flot see this example http://www.flotcharts.org/flot/examples/axes-multiple/index.html |
I've come across the same issue, so I'm having a crack to see if I can write something that will generate compatible ranges for both axes. Can't promise anything but if it bears fruit I'll both stick it on GitHub and have a look at making a PR out of it. |
@alexcjohnson Thanks for the hint about dtick and tick0. This helped for my use-case but some "automated" way of doing it would be even more awesome 😸 |
Just a quick idea: Isn't all that it takes to have the same amount of ticks and interdistance on both axes? Wouldn't something like |
That's enough for |
Would it be hard to implement |
Probably not very hard, want to give it a try? Plotly folks are a bit busy for the foreseeable future... |
I wish I had the time to dedicate, seriously, so I could give back to you guys for how you give to the community. Maybe I can tackle this in Feb/Mar 😭 |
Is there a fix so far? |
@andy1547 @Braintelligence @qxlsz @alexcjohnson @ankuradhey I’ve crafted a comprehensive solution. This was fairly rushed, so if there are any mistakes or confusions, please do let me know https://github.com/VictorBezak/Plotly_Multi-Axes_Gridlines |
@VictorBezak That's great. Thanks for that Victor. Trying it out now and it works well. |
@pkozul I'm glad it's making use for you! Just wanted to let you know that the current version isn't yet working for all cases of data that contain fractional values between 0 and 1, or for data that contains negative values. I'm still working on the code that nicely covers all cases. I'll follow up when it's complete |
@VictorBezak Sounds good. Having it work for fractional values will be a great enhancement, as a lot of the charts I'm working with contain a mixture of Y axes (i.e. one axis has large numbers in the millions, while the other axis has fractional numbers). Good luck (although I'm sure you won't need it)! |
For Python users, I have adapted @VictorBezak 's solution. See: https://gist.github.com/mschrader15/ccf4c4e9b5b1254a7d6b38a92fd88560 |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. Sponsorship range: $10k-$15k What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
Hey, @jackparmer ! I'd be happy to sponsor this feature. I've reached out via Plotly's "Contact Us" form. Is there a more preferred mode of contact from which I could get more details? Thanks! |
@jackparmer I'd love to help with the Python and Matlab integration. @VictorBezak should get 1st and 2nd dibs for the Plotly.js support though! |
Hi @VictorBezak & @mschrader15, thanks for your interest and enthusiasm! To clarify, we're seeking financial sponsorship for this feature (not providing it - I wish we were!) If you, the company that you're working for, or your university lab has budget to bring this feature to life, the Contact Us form linked above is indeed the best way to get in touch about a collaboration. |
@jackparmer I see, thanks for the clarification! I'm not sure if you've had a chance to view my implementation, but it's successful in providing the requested functionality. I believe all it needs to be ready for a PR is to be abstracted and integrated with Plotly's schema. Not sure what all may go into that, but I've begun working on it. My goal is to submit a community PR within the next few weeks. I'd be happy to provide assistance with documentation beyond this point, but first step is to actually follow through with the PR. Glad to connect with you, I'm always very enthusiastic to promote Plotly within my circle of data scientist friends. Besides the effort described above, let me know if there's anything I can do to help or contribute. https://github.com/VictorBezak/Plotly_Multi-Axes_Gridlines |
Impressive work! We'll be on the lookout for your community PR. Integrating with Plotly's schema is indeed a necessary sticking point - we have to be careful to make sure that any schema additions can stand the test of time and we don't accidentally back ourselves into a corner. Plotly's is the first schema that can describe most scientific figures in a machine readable way. That said, it's a huge accomplishment to submit a PR that makes a mark on this schema, especially as an undergrad! |
@jackparmer Making solid progress on this update! The path to completion isn't crystal clear, but I certainly haven't hit a wall yet. The pull request guide mentions that it's preferred for me to have a maintainer review the code on my forked copy before submitting a PR to the main plotly repo. I'm relatively naive when it comes to open source, so the best method I can think of to initiate this would be to contact plotly support and ask if they'll share my repo with a maintainer for review. If there is a better method, just let me know; Otherwise, I'll proceed with this plan and should be requesting a review by end of next weekend! |
@VictorBezak that's great! The preferred way to do this is:
|
@VictorBezak and everyone...thank you so much! i'm a newbie when it comes to all of this and hope i can someday make PR to large open source projects like you |
@alexcjohnson Hey, Alex! I stumbled through a few early mistakes, and I now feel I've gotten the additions quite close to complete. However, I'm struggling to bridge this final gap, which is resulting from a lack of understanding of how these underlying components are inheriting/importing from one another. Would it be possible to afford a few minutes of time from one of your team members? A brief conversation would most definitely be enough to get me moving in the right direction. If not possible, that's alright--I may just need a bit more time to consult with some friends whom are more experience than myself! |
@invictus2010 It's a journey, my friend. Wasn't long ago that I couldn't even visualize what a simple program might look like lol. This is a first attempt at an open source PR, and it may or may not be accepted. The attempt is what matters though, for every naive piece of code you write gets you one step closer to creating elegant and optimal code. If you ever have questions along your journey, feel free to reach out. |
@VictorBezak thanks for your effort! Hoping the plotly folks can get this reviewed and merged sometime soon so I can put it to good use! As in all projects I'm sure time is short and trello boards overflow. I just wanted to say thanks to both Victor and the Plotly team for continuing to make a great open source project even better and to express my continued interest in this feature. It looks like the PR is already awaiting review, but if there's anything I can do to help please let me know! |
@gjhami @invictus2010 I've been having trouble prioritizing this, would you guys like to colab on getting this ready to go? I find it's a little easier for me to make time for open-source when there's a social/team aspect to it. Would be a casual, zero expectation working session that we could schedule weekly or bi-weekly! Just let me know! I'm going to make this a higher priority in the mean time, so we'll get this done either way! |
That’s awesome! It’s been some time since I’ve looked at this code and I’m
not a dev in my fulltime gig, but I’m interested in helping out. I’m on
vacation this week and then start my new job.
TLDR; won’t be able to help for the next 2 weeks, but could link up after
that if you don’t solve it before then
…On Sun, Apr 10, 2022 at 2:39 PM Victor Bezak ***@***.***> wrote:
@gjhami <https://github.com/gjhami> @invictus2010
<https://github.com/invictus2010> I've been having trouble prioritizing
this, would you guys like to colab on getting this ready to go? I find it's
a little easier for me to make time for open-source when there's a
social/team aspect to it. Would be a casual, zero expectation working
session that we could schedule weekly or bi-weekly! Just let me know! I'm
going to make this a higher priority in the mean time, so we'll get this
done either way!
—
Reply to this email directly, view it on GitHub
<#1962 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEGXYSKFZYOQGQ6ZDWYHS4TVEMN6HANCNFSM4DXOXFSQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sounds great, man! I hope you enjoyed your vacation and have a great first week! Happy to do some casual co-lab whenever is convenient for you. Shoot me an email at [email protected] whenever you get settled with your new job and have a weekend where you feel up for it. I'll be able to catch you up to speed with where I'm at and we'll just chat and see if we can't make some progress! |
I've been receiving help for the last 5 weeks from fellow developer, Filipe Santiago @filipesantiagoAM, and together we've managed to put together an MVP solution! This still needs some tests and approvals before being merged, but sharing the PR here for public visibility! |
Resolved by #6356. |
This is best explained by the screenshot:

As you can see the grid squares differ in size, I'd like these to remain constant. Instead I'd like the y2 axis ticks to scale to match the y axis values, i.e. the y axis would step up like 10,20,30 but the y2 axis would step up with respect to those values i.e. 12, 24, 36 etc.
Is this possible with plotly?
The text was updated successfully, but these errors were encountered: