код, который у меня есть
Код: Выделить всё
for i, time_unit in enumerate(time_units):
fig = go.Figure()
df_year = df[df['year'] == time_unit]
months = sorted(df['month'].unique())
for j, month in enumerate(months):
df_month = df_year[df_year['month'] == month]
fig.add_trace(go.Violin(
x=df_month['metric_value'],
name=calendar.month_name[month],
side='negative',
box_visible=False
))
fig.update_layout(
title=f'Ridge Plot for Year {time_unit}',
xaxis_title='Metric Value',
yaxis_title='Month',
yaxis=dict(automargin=True, domain=[0.00, 0.00], autorange='reversed',),
violingap=0,
violingroupgap=0,
violinmode='overlay',
height=1200
)
fig.show()

это цель

Подробнее здесь: https://stackoverflow.com/questions/787 ... -in-plotly