Traceback (most recent call last):
File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5agg.py", line 80, in paintEvent
self._update_figure_dpi()
File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5.py", line 186, in _update_figure_dpi
dpi = self._dpi_ratio * self.figure._original_dpi
AttributeError: 'Figure' object has no attribute '_original_dpi'
Traceback (most recent call last):
File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5agg.py", line 80, in paintEvent
self._update_figure_dpi()
File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5.py", line 186, in _update_figure_dpi
dpi = self._dpi_ratio * self.figure._original_dpi
AttributeError: 'Figure' object has no attribute '_original_dpi'
It opens the window but the image is black
If I force to use a GTK3 backend I dont get the error and the figure is fine
@tacaswell if I make the change in backend_qt4agg.py.FigureCanvasQTAgg the error changes to
Traceback (most recent call last):
File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5.py", line 309, in resizeEvent
self.draw_idle()
File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5agg.py", line 143, in draw_idle
if not self._agg_draw_pending:
AttributeError: 'FigureCanvasQTAgg' object has no attribute '_agg_draw_pending'
Why it shows me the error in qt5? if it is qt4 in reality?
Ah! Because the qt4 backend is a sub-class of the qt5 backend. The main differences between them are that qt5 is co-opperative and qt4 is not which mostly shows up in the __init__ method.
will give you a visualization of the MI diagram from these classes (there are 3 diamonds, 1 from us, 1 from Qt and 1 from us + Qt back to object). At least on __init__ is not being properly called on the Qt4 side.
$> python3 setup.py build
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [2.1.0]
python: yes [3.6.3 (default, Oct 9 2017, 08:51:47) [GCC
7.2.0]]
platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.13.3]
six: yes [using six version 1.11.0]
dateutil: yes [using dateutil version 2.6.1]
backports.functools_lru_cache: yes [Not required]
subprocess32: yes [Not required]
pytz: yes [using pytz version 2017.2]
cycler: yes [using cycler version 0.10.0]
tornado: yes [using tornado version 4.5.2]
pyparsing: yes [using pyparsing version 2.2.0]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 2.8.1]
png: yes [version 1.6.32]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: no [skipping due to configuration]
toolkits_tests: no [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: yes [installing, Qt: 5.7.1, PyQt: 5.7.1; PySide2 not
found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 9.20]
latex: yes [version 3.14159265]
pdftops: yes [version 0.48.0]
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
Activity
fariza commented on Aug 15, 2017
maybe related to #8052
tacaswell commented on Aug 15, 2017
What sha are you at?
#9002 went in yesterday and may have fixed this.
fariza commented on Aug 15, 2017
I just pulled from master (20 min ago)
fariza commented on Aug 15, 2017
From git rev-parse HEAD
3769792
tacaswell commented on Aug 16, 2017
I can not reproduce this, I assume it has something to do some subtle ordering in when things are created and when things are attempted to be drawn.
Does applying
help?
fariza commented on Aug 16, 2017
@tacaswell no, I change the order and it doesn't help.
The FigureCanvasQT.__init__ its not being called.
I think FigureCanvasQTAggBase it's being called directly
fariza commented on Aug 16, 2017
@tacaswell if I make the change in backend_qt4agg.py.FigureCanvasQTAgg the error changes to
Traceback (most recent call last): File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5.py", line 309, in resizeEvent self.draw_idle() File "/home/fariza/workspace/matplotlib/lib/matplotlib/backends/backend_qt5agg.py", line 143, in draw_idle if not self._agg_draw_pending: AttributeError: 'FigureCanvasQTAgg' object has no attribute '_agg_draw_pending'Why it shows me the error in qt5? if it is qt4 in reality?
tacaswell commented on Aug 16, 2017
Ah! Because the qt4 backend is a sub-class of the qt5 backend. The main differences between them are that qt5 is co-opperative and qt4 is not which mostly shows up in the __init__ method.
tacaswell commented on Aug 17, 2017
will give you a visualization of the MI diagram from these classes (there are 3 diamonds, 1 from us, 1 from Qt and 1 from us + Qt back to object). At least on __init__ is not being properly called on the Qt4 side.
tacaswell commented on Aug 17, 2017
Will trace through what get called.
tacaswell commented on Aug 17, 2017
I have a patch that works but calls base class inits too many times....
FIX: shim Qt4 and Qt5 together better
5 remaining items
tacaswell commented on Oct 12, 2017
How did you install matplotlib? Are you using pyqt4 or pyqt5?
zerothi commented on Oct 12, 2017
Sorry about the 5.9, specification.
This is the print-out at installation:
$> python3 setup.py build Edit setup.cfg to change the build options BUILDING MATPLOTLIB matplotlib: yes [2.1.0] python: yes [3.6.3 (default, Oct 9 2017, 08:51:47) [GCC 7.2.0]] platform: yes [linux] REQUIRED DEPENDENCIES AND EXTENSIONS numpy: yes [version 1.13.3] six: yes [using six version 1.11.0] dateutil: yes [using dateutil version 2.6.1] backports.functools_lru_cache: yes [Not required] subprocess32: yes [Not required] pytz: yes [using pytz version 2017.2] cycler: yes [using cycler version 0.10.0] tornado: yes [using tornado version 4.5.2] pyparsing: yes [using pyparsing version 2.2.0] libagg: yes [pkg-config information for 'libagg' could not be found. Using local copy.] freetype: yes [version 2.8.1] png: yes [version 1.6.32] qhull: yes [pkg-config information for 'libqhull' could not be found. Using local copy.] OPTIONAL SUBPACKAGES sample_data: yes [installing] toolkits: yes [installing] tests: no [skipping due to configuration] toolkits_tests: no [skipping due to configuration] OPTIONAL BACKEND EXTENSIONS macosx: no [Mac OS-X only] qt5agg: yes [installing, Qt: 5.7.1, PyQt: 5.7.1; PySide2 not found] qt4agg: no [PySide not found; PyQt4 not found] gtk3agg: no [Requires pygobject to be installed.] gtk3cairo: no [Requires cairocffi or pycairo to be installed.] gtkagg: no [Requires pygtk] tkagg: yes [installing; run-time loading from Python Tcl / Tk] wxagg: no [requires wxPython] gtk: no [Requires pygtk] agg: yes [installing] cairo: no [cairocffi or pycairo not found] windowing: no [Microsoft Windows only] OPTIONAL LATEX DEPENDENCIES dvipng: no ghostscript: yes [version 9.20] latex: yes [version 3.14159265] pdftops: yes [version 0.48.0] OPTIONAL PACKAGE DATA dlls: no [skipping due to configuration]zerothi commented on Oct 12, 2017
I just noticed that in fact it is using PyQt 5.9, as I initially wrote. If I do:
So I guess there is a bug in the QT_VERSION_STR, I will try and report this to their mailing list.
zerothi commented on Oct 12, 2017
Ahh, no, of course. QT is the parent library, while PYQT is the python wrapper qt.
zerothi commented on Oct 12, 2017
In fact, I believe this to be a bug in setupext.py, it reads (@line 2077 and 2127)
while I guess it should read:
What do you think?
dopplershift commented on Oct 17, 2017
I think you're right, would you submit a PR for that fix? Not sure what's going wrong with your original problem, unfortunately.
tacaswell commented on Dec 18, 2017
@zerothi Do you still have this problem with 2.1.1?
tacaswell commented on Jan 8, 2018
Closing as we can not reproduce this with 2.1.1. Please ping to be re-opened if you can still reproduce this issue with the current stable release.