Black Lives Matter. Please consider donating to Black Girls Code today.

How to hide inner category tick labels and category divider/separator?

I am trying to hide the inner labels, but looks like it’s not supported as per: https://github.com/plotly/plotly.js/issues/3884

Hiding all the tick labels results in a divider cutting throw the graph. Is there way not hide this so that it doesn’t extend past the y axis or hide it all together?


df = pd.read_csv(
    "https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv")

fig = go.Figure()

days_yes = df['day'][df['smoker'] == 'Yes']
grouped_labels_yes = days_yes.map(
    {"Thur": "A", "Fri": "A", "Sat": "B", "Sun": "B"})
days_no = df['day'][df['smoker'] == 'No']
grouped_labels_no = days_no.map(
    {"Thur": "A", "Fri": "A", "Sat": "B", "Sun": "B"})

fig.add_trace(go.Violin(x=[grouped_labels_yes, days_yes],
                        y=df['total_bill'][df['smoker'] == 'Yes'],
                        legendgroup='Yes', scalegroup='Yes', name='Yes',
                        side='negative',
                        line_color='blue')
              )
fig.add_trace(go.Violin(x=[grouped_labels_no, days_no],
                        y=df['total_bill'][df['smoker'] == 'No'],
                        legendgroup='No', scalegroup='No', name='No',
                        side='positive',
                        line_color='orange')
              )
fig.update_traces(meanline_visible=True)
fig.update_layout(violingap=0, violinmode='overlay')
fig.update_xaxes(showticklabels=False)
fig.show()