You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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=Falseifis_log10elseTrue
)
fig.data[-1]["reversescale"] =reverse_colorscaleifcenter_around_zero:
fig.data[-1]["zmid"] =0else:
# both zmin and zmax are requiredfig.data[-1]["zmin"] =0fig.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 fig.data is the heatmap and you can change the heatmap properties. For this example, the color range will be set depending on if we want to center the expression values around zero or not.
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: