[Matplotlib-users] mplcairo crashes python3.10

Neal Becker ndbecker2 at gmail.com
Tue Dec 7 07:57:41 EST 2021


I'm using Fedora 35, with python3.10
mplcairo is  python3-mplcairo-0.4-3.fc35.x86_64, but I've also tried
pip install mplcairo and get the same result.

In matplotlibrc I have
backend: module://mplcairo.qt

Any simple plot to the screen results in:
-------------------
In [2]: Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/mplcairo/qt.py", line 36,
in paintEvent
    pixel_ratio = self.pixel_ratio
AttributeError: 'FigureCanvasQTCairo' object has no attribute 'pixel_ratio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/mplcairo/qt.py", line 38,
in paintEvent
    pixel_ratio = self._dpi_ratio
AttributeError: 'FigureCanvasQTCairo' object has no attribute '_dpi_ratio'
---------------

I had been using this same setup for quite some time, but perhaps it's
the update to Fedora34 that is now triggering the issue.
Any ideas?  I've already adapted many of my scripts to use
mplcairo.multipage so need this to work again.

Thanks,
Neal

-- 
Those who don't understand recursion are doomed to repeat it


More information about the Matplotlib-users mailing list