moshi4 / pyCirclize

Circular visualization in Python (Circos Plot, Chord Diagram, Radar Chart)
https://moshi4.github.io/pyCirclize/
MIT License
715 stars 42 forks source link

Track Heatmap cmap Customization #53

Open MattFill opened 7 months ago

MattFill commented 7 months ago

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

moshi4 commented 7 months ago

Hi @MattFill,

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

MattFill commented 7 months ago

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) <-----