pyCirclize icon indicating copy to clipboard operation
pyCirclize copied to clipboard

Track Heatmap cmap Customization

Open MattFill opened this issue 1 year ago • 2 comments

Hello,

Is it possible to adjust the vmin or vmax to a value below/above the min and max values of the data?

I get an error like this when I try and I'm wondering if there is a workaround: ValueError: value=0.13 is not in valid range (vmin=-0.18, vmax=0.097)

Also is it possible to set a center value to anchor the colors around? Similar to the functionality in seaborns heatmap.

Thanks

MattFill avatar Jan 25 '24 21:01 MattFill

Hi @MattFill,

Both of these are not possible with pyCirclize at this time. A solution may be considered in a future release.

moshi4 avatar Jan 27 '24 02:01 moshi4

Thanks for the update, @moshi4.

I was able to work around the error by commenting out the following line in track.py:

    # Calculate radius & x position range list of heatmap rectangle
    data_row_num, data_col_num = data.shape
    unit_r_size = self.r_plot_size / data_row_num
    unit_x_size = (end - start) / data_col_num
    # self._check_value_min_max(data, vmin, vmax) <----- 

MattFill avatar Jan 28 '24 15:01 MattFill