wdecoster / NanoPlot

Plotting scripts for long read sequencing data
http://nanoplot.bioinf.be
MIT License
413 stars 47 forks source link

Legacy KDE plots: contours not color filled #273

Closed thallinger closed 2 years ago

thallinger commented 2 years ago

I am using Nanoplot 1.38.1 with matplotlib 3.3.4 and seaborn 0.11.2. As the legacy KDE plots are informative and graphically appealing, I try to create them as follows:

NanoPlot -o NanoPlot_leg --loglength -f pdf --N50 --legacy kde --title Strain10 --fastq ONT.fastq.gz

The following warnings are displayed during execution ...

~/.local/lib/python3.6/site-packages/seaborn/distributions.py:1718: UserWarning:
`shade_lowest` is now deprecated in favor of `thresh`. Setting `thresh=0.05`, but please update your code.
~/.local/lib/python3.6/site-packages/seaborn/distributions.py:1213: UserWarning:
The following kwargs were not used by contour: 'stat_func'
~/.local/lib/python3.6/site-packages/seaborn/distributions.py:1718: UserWarning:
`shade_lowest` is now deprecated in favor of `thresh`. Setting `thresh=0.05`, but please update your code.
~/.local/lib/python3.6/site-packages/seaborn/distributions.py:1213: UserWarning:
The following kwargs were not used by contour: 'stat_func'

... and the KDE plot on the left is generated, where the color fill of the contours and the two kernel density estimates are missing. NanoPlot 1.29.0 generates the plot on the right:

LengthvsQualityScatterPlot_loglength_kde_issue_cropped

It would be nice, if the KDE plots would be created by the current NanoPlot version in the same form as previously.

wdecoster commented 2 years ago

Yes I agree I would much rather see the right result rather than the left. But this is not something that changed in NanoPlot, this comes from changes in seaborn. I will see if I can find how to get the previous output back. Meanwhile, downgrading your seaborn module to e.g. 0.10.1 should help.

thallinger commented 2 years ago

Thanks for the tip. Downgrading to seaborn 0.10.1 did the trick. The warnings are gone and the plots are as expected.