wdecoster / NanoPlot

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

AttributeError: 'PathCollection' object has no property 'stat_func' #201

Closed relvacode closed 3 years ago

relvacode commented 4 years ago

When installing NanoPlot using pip in a fresh environment of Python 3.6.9, seaborn 0.11.0 gets installed.

If I try to use the tool, specifically when generating a report from a sequencing_summary I get this

Traceback (most recent call last):
  File "minion/env/bin/NanoPlot", line 8, in <module>
    sys.exit(main())
  File "minion/env/lib/python3.6/site-packages/nanoplot/NanoPlot.py", line 101, in main
    plots = make_plots(datadf, settings)
  File "minion/env/lib/python3.6/site-packages/nanoplot/NanoPlot.py", line 169, in make_plots
    plot_settings=plot_settings)
  File "minion/env/lib/python3.6/site-packages/nanoplotter/nanoplotter_main.py", line 169, in scatter
    joint_kws={"s": 1})
  File "/minion/env/lib/python3.6/site-packages/seaborn/_decorators.py", line 46, in inner_f
    return f(**kwargs)
  File "minion/env/lib/python3.6/site-packages/seaborn/axisgrid.py", line 2070, in jointplot
    grid.plot_joint(scatterplot, **joint_kws)
  File "minion/env/lib/python3.6/site-packages/seaborn/axisgrid.py", line 1692, in plot_joint
    func(x=self.x, y=self.y, **kwargs)
  File "minion/env/lib/python3.6/site-packages/seaborn/_decorators.py", line 46, in inner_f
    return f(**kwargs)
  File "minion/env/lib/python3.6/site-packages/seaborn/relational.py", line 813, in scatterplot
    p.plot(ax, kwargs)
  File "minion/env/lib/python3.6/site-packages/seaborn/relational.py", line 601, in plot
    scout = ax.scatter(scout_x, scout_y, **kws)
  File "minion/env/lib/python3.6/site-packages/matplotlib/__init__.py", line 1438, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "minion/env/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "minion/env/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 4498, in scatter
    collection.update(kwargs)
  File "minion/env/lib/python3.6/site-packages/matplotlib/artist.py", line 996, in update
    raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'PathCollection' object has no property 'stat_func'

If I manually install 0.10.1 of seaborn which is the minimum required version for NanoPlot the script then works.

wdecoster commented 4 years ago

This leads me to think this is something about seaborn and matplotlib, and not necessarily involving NanoPlot. Could you try, for seaborn 0.11.0, to also upgrade matplotlib?

wdecoster commented 4 years ago

I just came across this issue myself, and have changed the required version of seaborn to 0.10.1 (and not just the minimum). I don't really have the time now to figure out what is wrong with seaborn 0.11.0.