Matplotlib FigureCanvas widget
See original GitHub issueHi, thanks a lot for magicgui,
Usecase
I’m trying to use it to create a simple waveform generator: choose a function (e.g scipy.signal.chirp) have the corresponding magic widget, and (among maybe other things), plot the result within the widget
Attempt
In order to do that, I tried to wrap the FigureCanvas class from matplotlib.backends.backend_qt5agg, which is a QWidget instance, in a Container, which, as discussed in #314 does not seem to be feasible.
Plea
Is there an easy way to do that? Could a FigureCanvas widget be implemented in magicgui?
As matplotlib is the most used plotting backend, and magicgui already depends on it, it seems to me that this would make sense for scientific applications.
Thanks for any hint!
Best,
Guillaume
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (13 by maintainers)
Top Results From Across the Web
matplotlib.widgets — Matplotlib 3.6.2 documentation
Connect a callback function with an event. This should be used in lieu of figure.canvas.mpl_connect since this function stores callback ids for later...
Read more >How can I make the FigureCanvas fill the entire Figure in a ...
I have attempted to make a GUI with embedded matplotlib widget in it. I just need the figure to be completely filled by...
Read more >Matplotlib plots in PyQt5, embedding charts in ... - Python GUIs
The FigureCanvasQTAgg class wraps this backend and displays the resulting image on a Qt widget. The effect of this architecture is that Qt ......
Read more >pyqt5 matplotlib - Python Tutorial - Pythonspot
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg ... We create a widget called PlotCanvas that includes the Matplotlib plot.
Read more >Source code for pyqtgraph.widgets.MatplotlibWidget
Qt import QtGui, QtCore, QT_LIB import matplotlib if QT_LIB != ... FigureCanvasQTAgg as FigureCanvas try: from matplotlib.backends.backend_qt4agg import ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For completeness, a POC implementation of the waveform generator is here:
https://gist.github.com/glyg/eedb11a681bea18190e28e01ecdf38f2
looks good! I’d probably use
cont.native.layout()instead ofcont.native.children()[0]… just in case it’s not the first child