Setting one bound of axis range not working

I’m trying to set the lower axis range to zero, the upper one should stay auto. However I don’t see axis changing when I set one of the bounds to be None. My plotly version is 6.6

import plotly.express as px

fig = px.scatter([0,6])
fig = fig.update_yaxes(range=[0, None])
display(fig)

HI @Madrigallo I am not sure I understand the issue.

What is your use-case? I guess you want to make sure the Y-axis always starts with 0 and leave the Y-max value “open” for plotly to scale the axis.

Why don’t you set the upper value of the range?

Hello! My use case is often to set the axis to start at zero but I don’t want to touch the upper limit. In this simple case I know the highest value exacatly, in real use I often handle data where I don’t know the maximum span (and also don’t want to hardcode it as it changes often).

Thanks!

I understand. How do you create the figure? At some when populating with data, you should be able to extract the maximum and adjust the ranges. That’s why I was asking for the use case.

Can you also replicate the behaviour I’m seeing? If so, I will report it as a bug. I’m not looking for a workaround, I already have that implemented.

Ok, just wanted to help and understand.

I get the same plot as shown above.

1 Like