简体   繁体   中英

matplotlib QtDesigner widget on Mac?

is there a matplotlib widget plugin for QTDesigner available for the Mac?

Why I care: I'm trying to GUI-ify an existing python/matplotlib/scipy/numpy application. I'd like to try to do this via QT and Qdesigner, but I'm new to them. I know I can implement the GUI apart from Designer "by hand" and have benefitted from "Chapter 6. Embedding Matplotlib in Qt 4" (from the book Matplotlib for Python Developers), and posts such as " http://eli.thegreenplace.net/2009/01/20/matplotlib-with-pyqt-guis/ " and " Embedding matplotlib in pyqt4 using imshow ". But supposedly there's a widget plugin for Designer that seems like it would help me out, and I can't seem to find it anywhere.

I've seen posts such as " Matplotlib widget in Qtdesigner ", but I can't seem to find a matplotlib plugin on my Mac's hard drive. (I'm using MacPorts, and pythonselect is set to the 2.7 version) The only plugins I seem to have are

/opt/local/share/qt4/plugins/designer/libpython27plugin.dylib
/opt/local/share/qt4/plugins/designer/libpython32plugin.dylib
/opt/local/share/qt4/plugins/designer/libqdeclarativeview.dylib
/opt/local/share/qt4/plugins/designer/libqt3supportwidgets.dylib
/opt/local/share/qt4/plugins/designer/libqwebview.dylib   
/opt/local/share/qt4/plugins/designer/libqwt_designer_plugin.dylib

Supposedly PythonXY supplies the matplotlib plugin, however according to the thread " PythonXY on Mac? " there is no available port of PythonXY...

So is there a way to plan out my full GUI this via a plugin in Designer (or some other solution), or will I just be hand-coding the matplotlib part in some frame?

Thanks.

PS- I see Cookbook instructions for building a matplotlib widget at scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer , however my version of Designer (4.8.4) looks nothing like the one described there. After creating a "Main Window", there is no "Tools" drop-down, and no opportunity to make Custom widgets...help? The current tutorial on making custom widgets, qt-project.org/doc/qt-4.8/designer-customwidgetplugin.html, I find as a newbie to be...kind of overwhelming.

PPS- I'm not married to QT4 either. Like I said, I'm brand new to that, so I'm totally fine if you wish to point to examples involving another (easier?) GUI building system such as Tkinter.

The Book Matplotlib for Python Developers explains in detail how you can add a Matplotlib figure in QtDesigner (platform independent). Fortunately, it's covered in the free sample chapter , see page 165.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM