Marsilea-viz / marsilea

Declarative creation of composable visualization for Python (Complex heatmap, Upset plot, Oncoprint and more~)
https://marsilea.rtfd.io/
MIT License
166 stars 6 forks source link

Add Numbers to heatmap #22

Closed robinfallegger closed 7 months ago

robinfallegger commented 7 months ago

Thank you so much for this amazing package!

I am not sure if this might already be possible with the current version, but it would be amazing if instead of adding markers to a heatmap, we could display the actual values on top of the heatmap.

Thanks a lot!

Mr-Milk commented 7 months ago

Thanks for using Marsilea!

There are two ways to achieve this:

  1. Pass annot=True to Heatmap, this is the same as seaborn.
  2. There is a hidden plotter called TextMesh (not documented yet), you can use .add_layer() to add TextMesh on top of the heatmap, this will give you finer control over the style etc.

I'm trying to improve the documentation these days, feel free to ask questions or give suggestions!

robinfallegger commented 7 months ago

@Mr-Milk Thanks so much ! The TextMesh solution worked perfectly.