Closed ghhar98 closed 2 years ago
That's a problem I hadn't think about. Thanks for bringing it up and I'll work on setting a global colorscale as default.
In the meantime you can add zmin
and zmax
to set the colorscale values as globals for all years.
If you know what the max and min values possible are, then use
fig.update_traces(
showscale = True,
selector=dict(type='heatmap'),
zmax=max_possible_value, # like 10 or 20
zmin=min_possible_value # like zero
)
If they vary from user to user user
fig.update_traces(
showscale = True,
selector=dict(type='heatmap'),
zmax=df["count"].max(),
zmin=df["count"].min() # or zero
)
Just published a new version addressing this issue by adding a colorscale
parameter and forcing the zmax of the colorscale to the global maximum of the dataframe.
I'm trying to make a calendar heatmap with years with different distributions, and it causes problems with the legend, as one can see in the screenshot.
As we can see, the high density number of event is different depending on the year, which causes problem.
This is the code i'm using :
Thank you.