You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve axis mirror: 'allticks' - to show multiple ticks/labels for the same axis #2539
Context:
I have multiple plots that I want to interact with that each have different y axes, but I want them synchronized on their x axes. Right now the best way I know how to do this with plotly.js is to have them be subplots which shrare a single x-axis - but this means that each subplot does not have axis ticks or labels - which will only be shown on the "primary" xaxis.
Ideally I want them to link together for interaction (panning / zooming) but remain distinct.
How i want it to look (labels on all x-axes) but these are subplots which do not share x-axes and therefore do not interact together:
How it looks when they share the same x-axis (and therefore interactivity):
Is there something I'm missing that will let me synchronize the x-axes across multiple subplots? or a way to have each subplot xaxis have the labels?
Right, there's no way to replicate the tick labels and title across multiple subplots. Once we implement #1549 that will be one way to do it, though that would be kind of heavy, both in terms of having to specify all the config multiple times and probably in terms of performance.
Better would be for us to make some options within the one axis to replicate its tick labels and/or title. It can also be nice to show labels both top and bottom, if you have a single especially-large subplot.
Supposedly we already have this for the tick marks using {ticks: 'inside', mirror: 'allticks'} but a) you're not using tick marks here so that wouldn't help you, and b) 'allticks' doesn't seem to work ATM - so I'll give this issue a bug label to remind us to fix that (though it's probably been broken for a while so it doesn't seem many people care about this...)
changed the title [-]Link axes together or show mutltiple labels for the same axis[/-][+]Improve axis `mirror: 'allticks'` - to show multiple ticks/labels for the same axis[/+]on Mar 18, 2019
The solution suggested by karlicoss did not work for me in javascript. However, I found another hack: add a css text-shadow to the xaxis svg container via css. For example adding two copies of the xaxis labels:
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson
Activity
alexcjohnson commentedon Apr 9, 2018
Right, there's no way to replicate the tick labels and title across multiple subplots. Once we implement #1549 that will be one way to do it, though that would be kind of heavy, both in terms of having to specify all the config multiple times and probably in terms of performance.
Better would be for us to make some options within the one axis to replicate its tick labels and/or title. It can also be nice to show labels both top and bottom, if you have a single especially-large subplot.
Supposedly we already have this for the tick marks using
{ticks: 'inside', mirror: 'allticks'}but a) you're not using tick marks here so that wouldn't help you, and b)'allticks'doesn't seem to work ATM - so I'll give this issue abuglabel to remind us to fix that (though it's probably been broken for a while so it doesn't seem many people care about this...)Ricardosgeral commentedon Jun 12, 2018
any news on this?
I have three subplots in a column and need to replicate the tick labels and x title in all of then.
How do i do it?
thanks
[-]Link axes together or show mutltiple labels for the same axis[/-][+]Improve axis `mirror: 'allticks'` - to show multiple ticks/labels for the same axis[/+]karlicoss commentedon Aug 20, 2019
I think I've managed to achieve this by explicitly setting the
showticklabelsattribute:I get simultaneous zooming and tick labels displayed under each subplot
HendrikRoehm commentedon Dec 22, 2019
The solution suggested by karlicoss did not work for me in javascript. However, I found another hack: add a css text-shadow to the xaxis svg container via css. For example adding two copies of the xaxis labels:
This should not harm the performance, but the offset has to be computed manually.
rpanai commentedon Apr 17, 2020
@karlicoss
you could avoid
getattrusingpablomadoery commentedon Jul 26, 2021
fig.update_xaxes(showticklabels=True) will show xticks for all subplots.
put it after making all subplots.
gvwilson commentedon Jun 11, 2024
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson