Iโm trying to use the built in plotly widgets to select values for marker size and color in scatter
and scatter_3d
from plotly express. I can get this working using ipwidgets
but then it resets the plot to the original orientation (3D). But when using updatemenus
instead nothing changes at all.
Hereโs an example code:
# stats is a pandas dataframe
fig = px.scatter(stats, x='x', y='y',
color='cube num', size='Radius [mm] mean' )
fig.update_layout(scene_aspectmode='data')
# fig.update_data(size='cube num')
fig.update_layout(updatemenus=[
dict(
buttons=list([
dict(
args=[{'size':stats['cube num']},],
label='cube #',
method='update'
),
dict(
args=[{'size':stats['Radius [mm] mean']},],
label='Average Radius',
method='update'
)
]),
showactive=True,
)
]
)
fig.show()
Iโve tried a number of variations to args
and different method
s.