Hi,
I’m trying to have a drop down menu to set one of the axis to be either linear or logarithmic.
Ideally what I do is to update the figure properties when of the button is pressed.
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
y=[8, 7, 6, 5, 4, 3, 2, 1, 0]
))
fig.add_trace(go.Scatter(
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
))
fig.update_layout(title_text="CIR plot ",
updatemenus=[
dict(
buttons=list([
dict(label="Linear", method="update", args=[{"yaxis":{"type": "linear"}}]),
dict(label="Log", method="update", args=[{"yaxis":{"type": "log"}}]),
]),
)])
# fig.update_layout(xaxis_type="log", yaxis_type="log")
fig.show()