liana-py icon indicating copy to clipboard operation
liana-py copied to clipboard

move LIANA+ plots to matplotlib and seaborn? [User Opinons Welcome]

Open dbdimitrov opened this issue 1 year ago • 5 comments

liana.pl currently relies on plotnine. While I chose this library due to how convenient it is to generate plots (and consistency with ggplot2), it's incompatibility with matplotlib is a drawback.

Incompatibility with matplotlib both in terms of not being able to append subplots, but also various unwanted formatting interactions.

I am considering changing from plotnine to matplotlib in a future release.

Any opinions for and against are welcome.

dbdimitrov avatar Jan 26 '24 08:01 dbdimitrov

Have you tried lets-plot? https://lets-plot.org/

It's also ggplot-inspired. I haven't tried yet but it's on my to-do list.

earmingol avatar Feb 14 '24 10:02 earmingol

I'm very much for this possibility! Matplotlib is very customizable, and fits well into the scanpy/scverse ecosystem well. Returning plots as objects like sc.pl.dotplot() and others allows further customization of text which are needed for publication - e.g. italicizing gene names, grouping interactions into categories, and other bespoke things. So having a modifiable object as the output, and not just printing the plot, is very helpful. Seaborn heatmaps/clustermaps return as objects which are customizable as well.

dnjst avatar Feb 14 '24 10:02 dnjst

@earmingol thanks, this one looks really cool, esp for spatial plots.

I was thinking more in the lines of @dnjst since I recently had to make some rather complicated plots, with panels combining liana and scverse ecosystem plots (i.e. matplotlib), and it's a struggle putting them together.

So, I thought I should remake all liana plots from plotnine (which I do like for personal use) to matpllib just for the sake of interoperability with other scverse plotting (and it provides detailed options to modify basically every element indeed @dnjst)

dbdimitrov avatar Feb 15 '24 09:02 dbdimitrov

It would also allow us to avoid the issues we experienced with plotnine and matplotlib @earmingol :)

dbdimitrov avatar Feb 15 '24 09:02 dbdimitrov

I totally support the matplotlib idea haha, just curious about lets-plot since it looks pretty easy to use and well maintained (it's a project from JetBrains)

earmingol avatar Feb 15 '24 11:02 earmingol