Skip to content

Allow to set set axis scaleanchor and scaleratio in template #3499

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

Closed
messismore opened this issue Dec 4, 2021 · 1 comment
Closed

Allow to set set axis scaleanchor and scaleratio in template #3499

messismore opened this issue Dec 4, 2021 · 1 comment

Comments

@messismore
Copy link

messismore commented Dec 4, 2021

It is currently not possible to set an axis' scaleanchor and scaleratio in a template:

import plotly.io as pio
import plotly.graph_objects as go

 pio.templates["constrained_axes"] = pio.templates["plotly_white"]
 pio.templates["constrained_axes"].update( go.layout.Template(
    layout_title="constrained_axes",
    layout_xaxis=dict(
        visible = False,
    ),
    layout_yaxis=dict(
        visible = False,
        scaleanchor = 'x',  #
        scaleratio = 1      #  these are currently ignored
    )
))

Using the template in a figure will render axes with different scales:

fig = px.line(df, 
        x="x", 
        y="y", 
        color="color", 
        template="constrained_axes")
fig.show()

It should render like this:

fig.update_yaxes(scaleanchor = "x", scaleratio = 1)
fig.show()

I'm plotting online.

@messismore messismore changed the title C Allow to set set axis scaleanchor and scaleratio in template Dec 4, 2021
@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants