-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clustergram: Set min and max for colorscale #709
Comments
A while back, I implemented a workaround to address some heatmap colorings for our own application fig = dashbio.Clustergram(
data=values
, column_labels=col_labels
, row_labels=row_labels
, hidden_labels=hidden_labels
, cluster=cluster
, col_dist=col_dist
, row_dist=row_dist
, center_values=center_around_zero
, color_map=colorscale
, display_ratio=0.3 # Make dendrogram slightly bigger relative to plot
, line_width=1 # Make dendrogram lines thicker
, log_transform=False if is_log10 else True
)
fig.data[-1]["reversescale"] = reverse_colorscale
if center_around_zero:
fig.data[-1]["zmid"] = 0
else:
# both zmin and zmax are required
fig.data[-1]["zmin"] = 0
fig.data[-1]["zmax"] = max(map(max, fig.data[-1]["z"])) # Highest z-value in 2D array
# do extra stuff and return "fig" Basically in the returned clustergram figure (fig), the last element in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to creating a clustergram using a correlation matrix, and I'd like the color scale to be from -1 to 1 regardless of what is present in the data. Without manually setting it the results can be deceiving visually.
In the plotly go heatmap you set it by specifying zmin and zmax, but I don't see an equivalent from the clustergram documentation here.
Here's what my clustergram looks like:
You can see that the color scale cuts off at around 0.35.
The text was updated successfully, but these errors were encountered: