當前位置: 首頁>>代碼示例>>Python>>正文


Python backend_qt5agg.FigureCanvasQTAgg方法代碼示例

本文整理匯總了Python中matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg方法的典型用法代碼示例。如果您正苦於以下問題:Python backend_qt5agg.FigureCanvasQTAgg方法的具體用法?Python backend_qt5agg.FigureCanvasQTAgg怎麽用?Python backend_qt5agg.FigureCanvasQTAgg使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib.backends.backend_qt5agg的用法示例。


在下文中一共展示了backend_qt5agg.FigureCanvasQTAgg方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: qSolveFigure

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def qSolveFigure(workspace):
    """GUI layout for quick simplifier

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        qSolLayout {QtWidgets.QVBoxLayout} -- quick simplifier layout
    """

    bg = workspace.palette().window().color()
    bgcolor = (bg.redF(), bg.greenF(), bg.blueF())
    workspace.qSolveFigure = Figure(edgecolor=bgcolor, facecolor=bgcolor)
    workspace.solcanvas = FigureCanvas(workspace.qSolveFigure)
    workspace.qSolveFigure.clear()
    qSolLayout = QtWidgets.QVBoxLayout()
    qSolLayout.addWidget(workspace.solcanvas)

    return qSolLayout 
開發者ID:aerospaceresearch,項目名稱:visma,代碼行數:21,代碼來源:qsolver.py

示例2: plotFigure2D

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def plotFigure2D(workspace):
    """GUI layout for plot figure

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        layout {QtWidgets.QVBoxLayout} -- contains matplot figure
    """
    workspace.figure2D = Figure()
    workspace.canvas2D = FigureCanvas(workspace.figure2D)
    # workspace.figure2D.patch.set_facecolor('white')

    class NavigationCustomToolbar(NavigationToolbar):
        toolitems = [t for t in NavigationToolbar.toolitems if t[0] in ()]

    workspace.toolbar2D = NavigationCustomToolbar(workspace.canvas2D, workspace)
    layout = QVBoxLayout()
    layout.addWidget(workspace.canvas2D)
    layout.addWidget(workspace.toolbar2D)
    return layout 
開發者ID:aerospaceresearch,項目名稱:visma,代碼行數:23,代碼來源:plotter.py

示例3: plotFigure3D

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def plotFigure3D(workspace):
    """GUI layout for plot figure

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        layout {QtWidgets.QVBoxLayout} -- contains matplot figure
    """
    workspace.figure3D = Figure()
    workspace.canvas3D = FigureCanvas(workspace.figure3D)
    # workspace.figure3D.patch.set_facecolor('white')

    class NavigationCustomToolbar(NavigationToolbar):
        toolitems = [t for t in NavigationToolbar.toolitems if t[0] in ()]

    workspace.toolbar3D = NavigationCustomToolbar(workspace.canvas3D, workspace)
    layout = QVBoxLayout()
    layout.addWidget(workspace.canvas3D)
    layout.addWidget(workspace.toolbar3D)
    return layout 
開發者ID:aerospaceresearch,項目名稱:visma,代碼行數:23,代碼來源:plotter.py

示例4: stepsFigure

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def stepsFigure(workspace):
    """GUI layout for step-by-step solution

    Arguments:
        workspace {QtWidgets.QWidget} -- main layout

    Returns:
        stepslayout {QtWidgets.QVBoxLayout} -- step-by-step solution layout
    """
    workspace.stepsfigure = Figure()
    workspace.stepscanvas = FigureCanvas(workspace.stepsfigure)
    workspace.stepsfigure.clear()
    workspace.scroll = QScrollArea()
    workspace.scroll.setWidget(workspace.stepscanvas)
    stepslayout = QVBoxLayout()
    stepslayout.addWidget(workspace.scroll)
    return stepslayout 
開發者ID:aerospaceresearch,項目名稱:visma,代碼行數:19,代碼來源:steps.py

示例5: __init__

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def __init__(self):
        super().__init__()

        self._thread_pool = QtCore.QThreadPool()
        self._pb_list = ProgressBarsList(self)

        self._list_of_files = FileListWidget()

        self._list_of_features = FeatureListWidget()
        self._feature_parameters = None

        self._figure = plt.figure()
        self._ax = self._figure.add_subplot(111)  # plot here
        self._ax.set_xlabel('Retention time [min]')
        self._ax.set_ylabel('Intensity')
        self._ax.ticklabel_format(axis='y', scilimits=(0, 0))
        self._label2line = dict()  # a label (aka line name) to plotted line
        self._canvas = FigureCanvas(self._figure)
        self._toolbar = NavigationToolbar(self._canvas, self) 
開發者ID:Arseha,項目名稱:peakonly,代碼行數:21,代碼來源:abstract_main_window.py

示例6: __init__

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def __init__(self,figureNumber): 
        super(MyFigureCanvas, self).__init__()
        
        ''' 嚴重警告: self.figure = plt.figure( 0 ) 0是指定全局標識 '''
        self.figureNumber = figureNumber
        self.figure = plt.figure(self.figureNumber)

        self.canvas = FigureCanvas(self.figure)
        
        self.layout = QtWidgets.QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0) #設置總的外圍邊框
        self.layout.addWidget(self.canvas)
        self.setLayout(self.layout)

        self.axList = []

        self.numberOfRows = 1 #圖片個數 (排列行數),默認為 1
        self.leftMargin = 40
        self.topMargin = 5
        self.rightMargin = 5
        self.bottomMargin = 20 
開發者ID:hello-sea,項目名稱:DeepLearning_Wavelet-LSTM,代碼行數:24,代碼來源:MyFigureCanvas.py

示例7: __init__

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def __init__(self,UpWidget): 
        super(MyFigureCanvas, self).__init__(UpWidget)
        self.figure = plt.figure(0)
        self.canvas = FigureCanvas(self.figure)

        self.layout = QtWidgets.QGridLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0) #設置總的外圍邊框
        self.layout.addWidget(self.canvas)
        self.setLayout(self.layout)

        self.axList = []

        # self.lineNumber = 0
        self.numberOfRows = 1 #圖片個數 (排列行數)
        self.leftMargin = 40
        self.topMargin = 5
        self.rightMargin = 5
        self.bottomMargin = 20

        self.iheight = self.height()
        self.iwidth = self.width() 
開發者ID:hello-sea,項目名稱:DeepLearning_Wavelet-LSTM,代碼行數:24,代碼來源:MyFigureCanvas.py

示例8: tabbed_qt4_window

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def tabbed_qt4_window(self):
        from PyQt4 import QtGui
        from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, NavigationToolbar2QT
        # mpl backend can already create instance
        # https://stackoverflow.com/a/40031190
        app = QtGui.QApplication.instance()
        if app is None:
            app = QtGui.QApplication([self.title])
        self.root_window = QtGui.QTabWidget()
        self.root_window.setWindowTitle(self.title)
        for name, fig in self.figures.items():
            tab = QtGui.QWidget(self.root_window)
            tab.canvas = FigureCanvasQTAgg(fig)
            vbox = QtGui.QVBoxLayout(tab)
            vbox.addWidget(tab.canvas)
            toolbar = NavigationToolbar2QT(tab.canvas, tab)
            vbox.addWidget(toolbar)
            tab.setLayout(vbox)
            for axes in fig.get_axes():
                if isinstance(axes, Axes3D):
                    # must explicitly allow mouse dragging for 3D plots
                    axes.mouse_init()
            self.root_window.addTab(tab, name)
        self.root_window.show()
        app.exec_() 
開發者ID:MichaelGrupp,項目名稱:evo,代碼行數:27,代碼來源:plot.py

示例9: tabbed_qt5_window

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def tabbed_qt5_window(self):
        from PyQt5 import QtGui, QtWidgets
        from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT
        # mpl backend can already create instance
        # https://stackoverflow.com/a/40031190
        app = QtGui.QGuiApplication.instance()
        if app is None:
            app = QtWidgets.QApplication([self.title])
        self.root_window = QtWidgets.QTabWidget()
        self.root_window.setWindowTitle(self.title)
        for name, fig in self.figures.items():
            tab = QtWidgets.QWidget(self.root_window)
            tab.canvas = FigureCanvasQTAgg(fig)
            vbox = QtWidgets.QVBoxLayout(tab)
            vbox.addWidget(tab.canvas)
            toolbar = NavigationToolbar2QT(tab.canvas, tab)
            vbox.addWidget(toolbar)
            tab.setLayout(vbox)
            for axes in fig.get_axes():
                if isinstance(axes, Axes3D):
                    # must explicitly allow mouse dragging for 3D plots
                    axes.mouse_init()
            self.root_window.addTab(tab, name)
        self.root_window.show()
        app.exec_() 
開發者ID:MichaelGrupp,項目名稱:evo,代碼行數:27,代碼來源:plot.py

示例10: __init__

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def __init__(self):
        super().__init__()

        self.interval = 60 # interval of visualization (in seconds)
        self.time_mem = -1

        self.cursor_color = "red"

        self.figure = Figure()

        self.canvas = FigureCanvas(self.figure)
        layout = QVBoxLayout()

        layout.addWidget(self.canvas)
        self.setLayout(layout)

        self.installEventFilter(self) 
開發者ID:olivierfriard,項目名稱:BORIS,代碼行數:19,代碼來源:plot_waveform_rt.py

示例11: create_graph

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def create_graph(self):
        # Create the graph widget.
        graphWidget = QtWidgets.QWidget()
        graphWidget.setObjectName("graph")

        # Style attributes of matplotlib.
        matplotlib.rcParams['lines.linewidth'] = 3
        matplotlib.rcParams['lines.color'] = '#2a2a2a'
        matplotlib.rcParams['font.size'] = 10.
        self.graphFigure = Figure(facecolor='#444952')
        self.graphCanvas = FigureCanvas(self.graphFigure)

        # Add graph widgets to layout for graph.
        graphVerticalBox = QtWidgets.QVBoxLayout()
        graphVerticalBox.addWidget(self.graphCanvas)
        graphWidget.setLayout(graphVerticalBox)

        # Animate the the graph with new data
        if self.animated:
            self.animateGraph = animation.FuncAnimation(self.graphFigure,
                self.graph_draw, interval=1000)
        else:
            self.graph_draw()

        return graphWidget 
開發者ID:Roastero,項目名稱:Openroast,代碼行數:27,代碼來源:customqtwidgets.py

示例12: __init__

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def __init__(self, parent=None):
        super(Mainwindow, self).__init__(parent)

        centralWidget = QWidget()
        self.setCentralWidget(centralWidget)
        self.fig = Figure()
        self.axes = self.fig.add_subplot(111)
        self.canvas = FigureCanvas(self.fig)
        self.gridLayout = QGridLayout(centralWidget)
        self.gridLayout.addWidget(self.canvas)   
        self.btn_plot = QCheckBox("Plot")
        self.btn_line = QCheckBox("Line")
        self.gridLayout.addWidget(self.btn_plot, 1,0,1,1)
        self.gridLayout.addWidget(self.btn_line, 2,0,1,1)
        self.btn_plot.clicked.connect(self.btnPlot)
        self.btn_line.clicked.connect(self.btnLine)

        self.Graphics = Graphics(self.axes) 
開發者ID:furas,項目名稱:python-examples,代碼行數:20,代碼來源:main.py

示例13: embedCollectionsBuilder

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def embedCollectionsBuilder(self):
        self.dpi = 100
        self.fig = plt.Figure()
        self.canvas = FigureCanvas(self.fig)
        self.ax = self.fig.add_subplot(111)
#        self.ax.set_axis_bgcolor("white")
        # when a button is pressed on the canvas?
        self.canvas.mpl_connect('button_press_event', self.onCollectionsClick)
        #self.canvas.mpl_connect('button_release_event', self.onCollectionsClick)
        self.canvas.mpl_connect('pick_event', self.onCollectionsPick)
        mpl_toolbar = NavigationToolbar(self.canvas, self.main_build_frame)
        self.gridLayout.addWidget(self.canvas)
        self.gridLayout.addWidget(mpl_toolbar)
        self.fig.subplots_adjust(
            left=0.0, right=1, top=1, bottom=0, wspace=0.02, hspace=0.04)
        self.dragged = None 
開發者ID:Tooblippe,項目名稱:pandapower_gui,代碼行數:18,代碼來源:pandapower_gui.py

示例14: __init__

# 需要導入模塊: from matplotlib.backends import backend_qt5agg [as 別名]
# 或者: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 別名]
def __init__(self, name, image, feature, alpha=0.5):
        super(Visualizer, self).__init__()
        self.name = name
        self.image = image
        self.feature = feature
        self.draw_feature = utils.visualize.DrawFeature(alpha)
        
        layout = QtWidgets.QVBoxLayout(self)
        fig = plt.Figure()
        self.ax = fig.gca()
        self.canvas = qtagg.FigureCanvasQTAgg(fig)
        layout.addWidget(self.canvas)
        toolbar = qtagg.NavigationToolbar2QT(self.canvas, self)
        layout.addWidget(toolbar)
        self.slider = QtWidgets.QSlider(QtCore.Qt.Horizontal, self)
        self.slider.setRange(0, feature.shape[0] - 1)
        layout.addWidget(self.slider)
        self.slider.valueChanged[int].connect(self.on_progress)
        
        self.ax.imshow(self.image)
        self.ax.set_xticks([])
        self.ax.set_yticks([])
        self.on_progress(0) 
開發者ID:ruiminshen,項目名稱:openpose-pytorch,代碼行數:25,代碼來源:demo_label.py


注:本文中的matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。