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

How to hide left side legends funnel charts

Hi everyone,

I’d like to hide those traces names on the left side of funnel’s plot,

and also if I need then, how can I change its font family/size?

import plotly.express as px

data = dict(
    number=[39, 27.4, 20.6, 11, 2], 
    stage=["Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent"])

fig = px.funnel(data, x='number', y='stage')

fig.show()

img got:

img expected:
image

thanks in advance!

Hi @paulogil2010 welcome to the forum! The labels are the tick labels of the y axis, therefore you can remove them with

import plotly.express as px

data = dict(
    number=[39, 27.4, 20.6, 11, 2], 
    stage=["Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent"])

fig = px.funnel(data, x='number', y='stage')
fig.update_yaxes(showticklabels=False)
fig.show()

(see https://plot.ly/python/axes for more examples about controlling the axes, in particular https://plot.ly/python/axes/#set-axis-label-rotation-and-font for the tickfont color and size). Also, if you a funnel area chart you will not have labels (see https://plot.ly/python/funnel-charts/#basic-area-funnel-plot-with-plotlyexpress).

1 Like

Nice!
Thank you, @Emmanuelle!