Reputation: 247
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
Upvotes: 4
Views: 3622
Reputation: 61214
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()
Upvotes: 7