Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with fancplot #178

Open
TomSexton00 opened this issue Dec 13, 2023 · 4 comments
Open

Issue with fancplot #178

TomSexton00 opened this issue Dec 13, 2023 · 4 comments

Comments

@TomSexton00
Copy link

TomSexton00 commented Dec 13, 2023

Hi, I've been a satisfied user of FAN-C for a number of years, but after a recent wave of server updates (we are now on FANC/0.9.27), there is now a bug with running a fancplot command which previously worked:

fancplot [REGION] -p triangular -vmax 0.05 [HIC OBJECT]

Now returns this error message:

/shared/software/miniconda3-admin/envs/fanc-0.9.27/bin/fancplot:187: UserWarning: There was an error with plot 0, region chr10:15000000-16000000 (Traceback (most recent call last):
  File "/shared/software/miniconda3-admin/envs/fanc-0.9.27/bin/fancplot", line 170, in __init__
    fig, axes = gf.plot(plot_region)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/plotter.py", line 211, in plot
    p.plot(r)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 293, in plot
    self._after_plot(region)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 581, in _after_plot
    self.add_colorbar()
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 651, in add_colorbar
    self.update_colorbar(vmin=self.vmin, vmax=self.vmax, baseline=baseline)
  File "/shared/home/sexton/.local/lib/python3.9/site-packages/fanc/plotting/base_plotter.py", line 669, in update_colorbar
    self.colorbar.draw_all()
AttributeError: 'Colorbar' object has no attribute 'draw_all'
)
  warnings.warn("There was an error with plot {}, region {}:{}-{} ({})".format(i, region.chromosome,
2023-12-13 11:44:13,046 WARNING 'Colorbar' object has no attribute 'draw_all'

Many thanks for your advice.

@kaukrise
Copy link
Collaborator

Hi Tom,

sorry about the delay - the time leading up to the holidays is always particularly busy.

The error is due to recent updates in Matplotlib. However, FAN-C 0.9.27 should have fixed the issue. Can you run

fancplot -V

to double-check that the correct version is installed? Sometimes the executable points to an older version despite being installed in a different environment.

I also downloaded the 0.9.27 source files directly from Pypi and the line that raises the error in your case (669 in base_plotter.py) is different. It should read

self.cax.figure.draw_without_rendering()

I hope you can figure out where the version mismatch comes from!

Best,

Kai

@TomSexton00
Copy link
Author

TomSexton00 commented Dec 20, 2023 via email

@TomSexton00
Copy link
Author

TomSexton00 commented Dec 20, 2023 via email

@ReytylerDurden
Copy link

Hi, i'm having a similar problem, but i've recently installed fanc for the first time, so is likely that the problem is me. My version of fancplot is the latest, like matplotlib, there is the error:


File "/home/omen/PycharmProjects/FancExt/main.py", line 30, in <module>
    p.plot('chr3')
  
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 293, in plot
    self._after_plot(region)
  
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 581, in _after_plot
    self.add_colorbar()
  
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/fanc/plotting/base_plotter.py", line 650, in add_colorbar
    self.colorbar = plt.colorbar(cmap_data, cax=ax, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/matplotlib/pyplot.py", line 2326, in colorbar
    ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/omen/Scrivania/venv/lib/python3.11/site-packages/matplotlib/figure.py", line 1285, in colorbar
    raise ValueError(
ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.`


I would like to take this opportunity to wish you a merry Christmas and kindly thank you for your support
Ciro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants