当前位置: 首页>>代码示例>>Python>>正文


Python FigureCanvasQTAgg.setSizePolicy方法代码示例

本文整理汇总了Python中matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.setSizePolicy方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.setSizePolicy方法的具体用法?Python FigureCanvasQTAgg.setSizePolicy怎么用?Python FigureCanvasQTAgg.setSizePolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg的用法示例。


在下文中一共展示了FigureCanvasQTAgg.setSizePolicy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
	def __init__(self):
		self.fig = Figure()
		FigureCanvas.__init__(self, self.fig)
		FigureCanvas.setSizePolicy(self,
			QSizePolicy.Expanding,
			QSizePolicy.Expanding)
		FigureCanvas.updateGeometry(self)
开发者ID:scholi,项目名称:pySPM,代码行数:9,代码来源:mplwidget.py

示例2: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
 def __init__(self):
     self._fig = Figure(dpi=170)
     FigureCanvasQTAgg.__init__(self, self._fig)
     FigureCanvasQTAgg.setSizePolicy(self,
                                     QtWidgets.QSizePolicy.Expanding,
                                     QtWidgets.QSizePolicy.Expanding)
     self._fig.subplots_adjust(left=0, right=1, top=1, bottom=0)
     self._mpl_toolbar = NavigationToolbar2QTAgg(self, self)
     self._mpl_toolbar.hide()
     self.__taking = False
     self._scale = 'log'
     self._scales = OrderedDict()
     self._scales['Logarithmic'] = 'log'
     self._scales['Linear'] = 'linear'
     self._scales['Square Root'] = 'sqrt'
     self._scales['Power'] = 'power'
     self._scales['Arc Sinh'] = 'arcsinh'
     self._gc = None
     self._upperCut = 99.75
     self._lowerCut = 0.25
     self._cmap = 'gray'
     self._refresh_timer = QtCore.QTimer(self)
     self._refresh_timer.setSingleShot(True)
     self._refresh_timer.timeout.connect(self._refreshConcrete)
     self.apertures = []
开发者ID:badders,项目名称:pyfitsview,代码行数:27,代码来源:fitsview.py

示例3: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, parent=None, width=6, height=4, dpi=110):
        """
        Init canvas.
        """

        self.fig = Figure(figsize=(width, height), dpi=dpi)

        # Here one can adjust the position of the CTX plot area.
        # self.axes = self.fig.add_subplot(111)
        self.axes = self.fig.add_axes([0.1, 0.1, 0.85, 0.85])
        self.axes.grid(True)
        self.axes.set_xlabel("(no data)")
        self.axes.set_ylabel("(no data)")

        FigureCanvas.__init__(self, self.fig)

        layout = QVBoxLayout(parent)
        layout.addWidget(self)
        parent.setLayout(layout)

        FigureCanvas.setSizePolicy(self,
                                   QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)

        # next too lines are needed in order to catch keypress events in plot canvas by mpl_connect()
        FigureCanvas.setFocusPolicy(self, QtCore.Qt.ClickFocus)
        FigureCanvas.setFocus(self)
开发者ID:pytrip,项目名称:pytripgui,代码行数:30,代码来源:plot_volhist.py

示例4: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self):

        self.press = None
        self.cur_xlim = None
        self.cur_ylim = None
        self.x0 = None
        self.y0 = None
        self.x1 = None
        self.y1 = None
        self.xpress = None
        self.ypress = None
        self.zoom_x_limits = None
        self.zoom_y_limits = None

        self.fig = Figure()
        self.ax = self.fig.add_subplot(111, axisbg='white')

        FigureCanvas.__init__(self, self.fig)
        FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding, QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)

        scale = 1.2
        f = self.zoom_factory(self.ax, base_scale=scale)
        # p = self.pan_factory(self.ax)

        self.dragged = None
        self.element_dragged = None
        self.pick_pos = (0, 0)
        self.is_point = False
        self.index = None
开发者ID:SanPen,项目名称:GridCal,代码行数:32,代码来源:matplotlibwidget.py

示例5: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
 def __init__(self):
     self.fig = Figure()
     self.ax = self.fig.add_subplot(111)
     FigureCanvas.__init__(self, self.fig)
     FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding,
                                QSizePolicy.Expanding)
     FigureCanvas.updateGeometry(self)
开发者ID:apryet,项目名称:Qgridder,代码行数:9,代码来源:mplwidget.py

示例6: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, parent):
        self._driver = AddieDriver()
        # from mpl_toolkits.axes_grid1 import host_subplot
        # import mpl_toolkits.axisartist as AA
        # import matplotlib.pyplot as plt

        # Instantiating matplotlib Figure
        self.fig = Figure()
        self.fig.patch.set_facecolor('white')

        self.axes = self.fig.add_subplot(111, projection='mantid')
        self.fig.subplots_adjust(bottom=0.15)

        # Initialize parent class and set parent
        FigureCanvasQTAgg.__init__(self, self.fig)
        self.setParent(parent)

        # Set size policy to be able to expanding and resizable with frame
        FigureCanvasQTAgg.setSizePolicy(self, QSizePolicy.Expanding, QSizePolicy.Expanding)
        FigureCanvasQTAgg.updateGeometry(self)

        # Variables to manage all lines/subplot
        self._lineDict = {}
        self._lineIndex = 0

        # legend and color bar
        self._colorBar = None
        self._isLegendOn = False
        self._legendFontSize = 10
开发者ID:neutrons,项目名称:FastGR,代码行数:31,代码来源:canvas.py

示例7: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
 def __init__(self, parent=None):
     self.fig = Figure()
     self.axes = self.fig.add_subplot(1, 1, 1)
     FigureCanvas.__init__(self, self.fig)
     self.setParent(parent)
     FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding, QSizePolicy.Expanding)
     FigureCanvas.updateGeometry(self)
开发者ID:olivierfriard,项目名称:BORIS,代码行数:9,代码来源:plot_data_module.py

示例8: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self):

        self._draw_count = 0
        interactive = matplotlib.is_interactive()
        matplotlib.interactive(False)
        self.roi_callback = None

        self._draw_zoom_rect = None

        self.fig = Figure(facecolor=settings.BACKGROUND_COLOR)

        FigureCanvas.__init__(self, self.fig)
        FigureCanvas.setSizePolicy(self,
                                   QtWidgets.QSizePolicy.Expanding,
                                   QtWidgets.QSizePolicy.Expanding)

        FigureCanvas.updateGeometry(self)
        self.manager = FigureManager(self, 0)
        matplotlib.interactive(interactive)

        self._resize_timer = QtCore.QTimer()
        self._resize_timer.setInterval(250)
        self._resize_timer.setSingleShot(True)
        self._resize_timer.timeout.connect(self._on_timeout)

        self.renderer = None
开发者ID:jzuhone,项目名称:glue,代码行数:28,代码来源:widget.py

示例9: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, parent=None, width=5, height=4, dpi=100):
        self.press = None
        self.prevX = 0
        self.ydata = list()
        self.xdata = list()
        fig = Figure(figsize=(width, height), dpi=dpi)

        self.axes = fig.add_subplot(111)

        self.axes.hold(True)

        #self.compute_initial_figure()

        #
        FigureCanvas.__init__(self, fig)
        self.setParent(parent)

        FigureCanvas.setSizePolicy(self,
                                   QtWidgets.QSizePolicy.Expanding,
                                   QtWidgets.QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        FigureCanvas.mpl_connect(self,'button_press_event', self.onclick)
        FigureCanvas.mpl_connect(self, 'button_release_event', self.onrelease)
        FigureCanvas.mpl_connect(self, 'motion_notify_event', self.onmove)
        FigureCanvas.mpl_connect(self, 'scroll_event', self.zoom)
        FigureCanvas.mpl_connect(self, 'pick_event', self.onpick)
        FigureCanvas.mpl_connect(self, 'figure_enter_event', self.on_enter)
        FigureCanvas.mpl_connect(self, 'figure_exit_event', self.on_exit)
开发者ID:St659,项目名称:QcmdThing,代码行数:30,代码来源:QCMDAnalyser.py

示例10: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, parent=None, width=5, height=4, dpi=60):
        """
        Descript. :
        """
        self.mouse_position = [0, 0]
        self.max_plot_points = None

        self.fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = self.fig.add_subplot(111)

        FigureCanvas.__init__(self, self.fig)
        self.setParent(parent)
        FigureCanvas.setSizePolicy(
            self, QtImport.QSizePolicy.Expanding, QtImport.QSizePolicy.Expanding
        )
        FigureCanvas.updateGeometry(self)

        self.single_curve = None
        self.real_time = None
        self._axis_x_array = np.empty(0)
        self._axis_y_array = np.empty(0)
        self._axis_x_limits = [None, None]
        self._axis_y_limits = [None, None]

        self._curves_dict = {}
        self.setMaximumSize(2000, 2000)
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:28,代码来源:matplot_widget.py

示例11: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self):
        self.fig = Figure(facecolor="white", frameon=False)
        self.ax = self.fig.add_subplot(111)

        FigureCanvas.__init__(self, self.fig)
        FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
开发者ID:andrewpaulreeves,项目名称:soapy,代码行数:9,代码来源:gui.py

示例12: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, xlim=None, ylim=None, channel=1, x_range=None,
                 parent=None, post_process=None, width=5, height=4, dpi=100,
                 *args, **kwargs):

        customthreads.StoppableThread.__init__(self, *args, **kwargs)

        self.lock = Lock()
        self.in_queue = queue.Queue()

        self.xlim = xlim
        self.ylim = ylim
        self.x_range = x_range

        if(self.x_range is None):
            self.x_range = range(self.xlim[0], self.xlim[1])

        self.fig = Figure(figsize=(width, height), dpi=dpi)
        FigureCanvasQTAgg.__init__(self, self.fig)
        FigureCanvasQTAgg.setSizePolicy(self,
                                        QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Expanding)
        FigureCanvasQTAgg.updateGeometry(self)

        self.axes_list = []
        self.setParent(parent)

        self.set_channel(channel)

        self.post_process = post_process
        if(self.post_process is None):
            self.post_process = lambda data: data
开发者ID:haven04,项目名称:PyAudioVisualizer,代码行数:33,代码来源:qt_mplcanvas.py

示例13: Statistics

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
class Statistics():
    def __init__(self, stat_label, parent, width=3, height=4, dpi=100):

        self.fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = self.fig.add_subplot(111)
        self.axes.hold(False)

        self.canvas = FigureCanvasQTAgg(self.fig)
        parent.addWidget(self.canvas, 1, 0, 1, 1)

        self.canvas.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
        self.canvas.updateGeometry()

        self.stat_label = stat_label;
        self.reset()

    def refresh(self, stats):
        # stats.print()
        _translate = QtCore.QCoreApplication.translate
        self.stat_label.setText(_translate("MainWindow", stats.print()))
        # counters
        foodCnt = stats.foodCnt()
        self.foods.append(foodCnt.existing)
        self.stepNumbers.append(stats.stepNumber())
        # plot
        self.axes.plot(self.stepNumbers, self.foods)
        self.axes.set_xlabel("Step number")
        self.axes.set_ylabel("Food count")
        self.canvas.draw()

    def reset(self):
        self.foods = []
        self.stepNumbers = []
开发者ID:Kamilcuk,项目名称:Anthill,代码行数:35,代码来源:mainWindow.py

示例14: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, parent, width=5, height=4, dpi=100, **kwargs):

        self.v = parent

        self.fig = Figure(figsize=(width, height), dpi=dpi)
        self.ax = self.fig.add_subplot(111)
        
        self.ax.plot([1, 2, 3, 4])

        self.ax.spines['top'].set_visible(False)
        self.ax.spines['right'].set_visible(False)
        self.ax.get_xaxis().tick_bottom()
        self.ax.get_yaxis().tick_left()

        FigureCanvas.__init__(self, self.fig)

        self.setParent(parent.views)

        FigureCanvas.setSizePolicy(self,
                                   QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        
        # Install navigation handler; we need to provide a Qt interface that can handle multiple 
        # plots in a window under separate tabs
        self.navigation = MplNavigationHandler(self)

        self._current_axis_bounds = None
开发者ID:nickos556,项目名称:pathomx,代码行数:30,代码来源:views.py

示例15: __init__

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import setSizePolicy [as 别名]
    def __init__(self, parent=None,
                 size = (7,3.5),
                 dpi = 100,
                 logx = False,
                 logy = False,
                 legends = True,
                 bw = False):

        self.fig = Figure(figsize=size, dpi=dpi) #in inches
        FigureCanvas.__init__(self, self.fig)
        FigureCanvas.setSizePolicy(self,
                                   qt.QSizePolicy.Expanding,
                                   qt.QSizePolicy.Expanding)
        self.curveTable = None
        self.dpi=dpi
        ddict = {'logx':logx,
                 'logy': logy,
                 'legends':legends,
                 'bw':bw}
        self.ax=None
        self.curveList = []
        self.curveDict = {}
        self.setParameters(ddict)
        #self.setBlackAndWhiteEnabled(bw)
        #self.setLogXEnabled(logx)
        #self.setLogYEnabled(logy)
        #self.setLegendsEnabled(legends)

        self.xmin = None
        self.xmax = None
        self.ymin = None
        self.ymax = None
        self.limitsSet = False
开发者ID:dnaudet,项目名称:pymca,代码行数:35,代码来源:QPyMcaMatplotlibSave1D.py


注:本文中的matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.setSizePolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。