I’d like to get the limits of the xaxis but I’m struggling to find a method to do this. If fig.update_layout(xaxis=dict(range=[x1,x2]))
has been called then fig.layout.xaxis.range
will return the range (but not really useful because its already known).
If I try:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(
go.Scatter(x=[10, 20, 40], y=[4, 6, 5,])
)
print(fig.layout.xaxis.range)
fig.show()
it returns None
for print(fig.layout.xaxis.range)
. Is there a way to get this range for an axis?
thx!