Skip to content

Updating layout of specific subplot  #2483

Closed
@ghost

Description

Hi 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.

Screenshot_1

Then this is my attempt at editing the axes, yet this only updates the first plot.

Screenshot_2

This is my result, and it's really frustrating because I just want my axes labeled...

result

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?

Screenshot_3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions