I'm using plotly Express density_heatmap and i'm trying to update manually the name of the legend (here the color continuous scale). I tried with labels, update_layout but it looks like i can't remove the 'sum of' or 'count' etc from the legend. Here i modified example from plotly:
import plotly.express as px
dft = px.data.iris()
figt = px.density_heatmap(dft, x="sepal_width", y="sepal_length", z='sepal_length',
labels=dict(z='sepal_length'))
figt.show()

Is there a way to remove this sum of? Thanks in andvance
You can use:
figt.update_layout(coloraxis_colorbar_title_text = 'your title')

import plotly.express as px
dft = px.data.iris()
figt = px.density_heatmap(dft, x="sepal_width", y="sepal_length", z='sepal_length',
labels=dict(z='sepal_length'))
figt.update_layout(coloraxis_colorbar_title_text = 'your title')
figt.show()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With