Matplotlib Window export

54 views
Skip to first unread message

Justin

unread,
Mar 17, 2015, 6:23:03 PM3/17/15
to pyqt...@googlegroups.com
Hi,

I was recently exploring different export options for plots and stumbled across the ability to export to a matplotlib window.  I tried it and it failed giving the following error:

File "C:\Python27\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 115, in paintEvent
    p.drawPixmap(QtCore.QPoint(0, 0), QtGui.QPixmap.fromImage(qImage))
TypeError: newinit() takes exactly 2 arguments (1 given)

I messed around with it for a minute and determined it's from the fromImage call.  Any ideas?

Thanks,
Justin

Luke Campagnola

unread,
Mar 21, 2015, 8:44:23 PM3/21/15
to pyqt...@googlegroups.com
It looks like the error is in matplotlib. Are you able to use matplotlib with the qt4agg backend on your machine?

--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/62854839-b123-4fa2-b9a2-5135dd2ecd13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin

unread,
Mar 25, 2015, 6:18:06 PM3/25/15
to pyqt...@googlegroups.com
Hi Luke,

I thought maybe it was an issue with my version of matplotlib being outdated, so I updated from 1.31 to the current version and now the error is the same except it references backend_qt5agg.py in the error message instead of qt4agg.  I tried a simple plot after manually specifying the backend and it works fine as far as I can tell.  Any diagnostics you can think of?

Thanks,
Justin
Reply all
Reply to author
Forward
0 new messages