saezlab / liana-py

LIANA+: an all-in-one framework for cell-cell communication
http://liana-py.readthedocs.io/
GNU General Public License v3.0
169 stars 21 forks source link

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

Open dbdimitrov opened 10 months ago

dbdimitrov commented 10 months ago

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.

earmingol commented 9 months ago

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.

dnjst commented 9 months ago

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.

dbdimitrov commented 9 months ago

@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 commented 9 months ago

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

earmingol commented 9 months ago

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)