Skip to content

Has anyone created Matplotlib widgets? #104

Answered by leon-thomm
isConic asked this question in Q&A
Discussion options

You must be logged in to vote

I actually did some tests a long time ago, so I just recycled some of that old code. Here is a tiny example that should include most code needed to get it running with Qt:

nodes.py

from ryven.NWENV import *
from qtpy.QtWidgets import QWidget, QVBoxLayout

import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Qt5Agg')
from matplotlib.backends.backend_qt5agg import FigureCanvas, NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure


class PlotWidget(MWB, QWidget):
    def __init__(self, params):
        MWB.__init__(self, params)
        QWidget.__init__(self)

        # Matplotlib
        self.canvas = FigureCanvas(Figure(figsize=(5, 3)))
        self.ax 

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@isConic
Comment options

Answer selected by isConic
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants