Plotly: How to give different label names in a dropdown menu?
问题 I was learning plotly dropdown menu and stumbled on a label problem. Question How to show labels sin and sin-1 when selected Sine. And show labels tan and tan-1 when selected Tan? MWE # imports import plotly.graph_objects as go import numpy as np # data x = np.linspace(-np.pi, np.pi, 100) y1 = np.sin(x) y1b = y1-1 y2 = np.tan(x) y2b = y2-1 # plotly setup fig = go.Figure() # Add one ore more traces fig.add_traces(go.Scatter(x=x, y=y1,name='sin')) fig.add_traces(go.Scatter(x=x, y=y1b,name='sin