Skip to content

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

Closed

Description

@messismore

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.

Activity

  1. changed the title [-]C[/-] [+]Allow to set set axis scaleanchor and scaleratio in template[/+] on Dec 4, 2021
  2. gvwilson commented on Jun 26, 2024

    @gvwilson
    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

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