vaquerizaslab / fanc

FAN-C: Framework for the ANalysis of C-like data
GNU General Public License v3.0
107 stars 14 forks source link

'Figure' object has no attribute 'draw_without_rendering' #179

Closed AlcaArctica closed 10 months ago

AlcaArctica commented 10 months ago

I am consistently getting the error 'Figure' object has no attribute 'draw_without_rendering', independent of the input file (.hic or .cool) and the regions or plot types specified. I have not used fancplot before, but I am using the current version (fancplot -V 0.9.27). Any ideas how to fix this? Thanks

Here is a complete example:

fancplot assembly:6mb-10mb -p triangular hap1.hic@5000
2024-01-17 09:06:48,059 INFO Found 1 regions
/lustre/projects/dazzler/uelze/conda_envs/fancplot/bin/fancplot:190: UserWarning: There was an error with plot 0, region assembly:6000000-10000000 (Traceback (most recent call last):
  File "/lustre/projects/dazzler/uelze/conda_envs/fancplot/bin/fancplot", line 170, in __init__
    fig, axes = gf.plot(plot_region)
  File "/lustre/projects/dazzler/uelze/conda_envs/fancplot/lib/python3.7/site-packages/fanc/plotting/plotter.py", line 211, in plot
    p.plot(r)
  File "/lustre/projects/dazzler/uelze/conda_envs/fancplot/lib/python3.7/site-packages/fanc/plotting/base_plotter.py", line 293, in plot
    self._after_plot(region)
  File "/lustre/projects/dazzler/uelze/conda_envs/fancplot/lib/python3.7/site-packages/fanc/plotting/base_plotter.py", line 581, in _after_plot
    self.add_colorbar()
  File "/lustre/projects/dazzler/uelze/conda_envs/fancplot/lib/python3.7/site-packages/fanc/plotting/base_plotter.py", line 651, in add_colorbar
    self.update_colorbar(vmin=self.vmin, vmax=self.vmax, baseline=baseline)
  File "/lustre/projects/dazzler/uelze/conda_envs/fancplot/lib/python3.7/site-packages/fanc/plotting/base_plotter.py", line 669, in update_colorbar
    self.cax.figure.draw_without_rendering()
AttributeError: 'Figure' object has no attribute 'draw_without_rendering'
)
kaukrise commented 10 months ago

draw_without_rendering was introduced in matplotlib 3.5: https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.5.0.html

It seems as though your matplotlib version might be outdated?

pip install -U matplotlib
AlcaArctica commented 10 months ago

Yes, that solved the problem. Thank you very much!