Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels