DingWB / PyComplexHeatmap

PyComplexHeatmap: A Python package to plot complex heatmap (clustermap)
https://dingwb.github.io/PyComplexHeatmap/
MIT License
297 stars 32 forks source link

is it possible to limit colorbar vmin and vmax ? #49

Closed hfl112 closed 1 year ago

hfl112 commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

I am wordering can I center the colorbar with white representing 0 values ?? plt.figure(figsize=(10, 4))


cm = ClusterMapPlotter(data=df_heatmap.T,
                       col_cluster=False,row_cluster=False,
                       row_split=df.Group,col_split=2,
                       col_split_gap=0.5,row_split_gap=0.8,
                       label='values',row_dendrogram=True,
                       show_rownames=False,show_colnames=True,
                       tree_kws={'row_cmap': 'Set1'},verbose=0,legend_gap=5,
                       cmap='bwr',xticklabels_kws={'labelrotation':90,'labelcolor':'black'},
                       #legend_kws={'vmin':-2,'vmax':2}

                      )
#plt.savefig("example0.pdf", bbox_inches='tight')
plt.show()

image

DingWB commented 1 year ago

Yes. You can use vmax, vmin, and center, just similar to seaborn.

hfl112 commented 1 year ago

Yes. You can use vmax, vmin, and center, just similar to seaborn.

Thanks