Updating layout of specific subplot
See original GitHub issueHi there. I’ve spent the past few hours browsing the plotly documentation and stackoverflow to solve my problem, but I find nothing.
What I want to do, is update the layout of a specific subplot. If this is not possible, then updating all of them is fine as well.
I’ve tried -> https://plotly.com/python/subplots/
In the form of fig.update_xaxes(title_text="xaxis 1 title", row=1, col=1)
But this did not work.
I’ve also tried to update the layout by trying to set xaxis2, as some Stack Overflow users suggested, this just gave me a key error. Maybe this was an old functionality?
From -> https://plotly.com/python/3d-axes/
I’ve tried: fig.update_layout(scene = dict( xaxis_title='X AXIS TITLE', yaxis_title='Y AXIS TITLE', zaxis_title='Z AXIS TITLE'), width=700, margin=dict(r=20, b=10, l=10, t=10))
This works, however it only updates the first subplot I have.
Essentially this is the code I have for adding the trace objects.
Then this is my attempt at editing the axes, yet this only updates the first plot.
This is my result, and it’s really frustrating because I just want my axes labeled…
As you can probably see, the first plot is nicely zoomed out as well, however I have the exact same problem that when I update the layout, it only updates the first plot instead of all of them.
This is my make subplots code. While I’m glad that there’s a subplot_titles argument, is there no functionality to do the same for the axes of the plots?
In another issue I saw one of the developers of Plotly reply that update_xaxes, and update_yaxes is the way to do this, but as I mentioned before this did not do anything for me. No errors, just the plots and no updated labels.
If anyone’s knowledgeable in this, then thanks in advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
You know, the thought passed through my mind that it could’ve been only applicable to 2D plots (-:
In any case… I got it to work now. Thanks a bunch, Nicolas! Awesome of you to reply so quickly.
If anyone gets to this topic somehow with the same problem here’s how I fixed it.
Hi Nicolas Thank you so much, This works brilliantly. Best wishes, Martin