本文整理汇总了Python中matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.setMinimumWidth方法的具体用法?Python FigureCanvasQTAgg.setMinimumWidth怎么用?Python FigureCanvasQTAgg.setMinimumWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg
的用法示例。
在下文中一共展示了FigureCanvasQTAgg.setMinimumWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: r_rep_widget
# 需要导入模块: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg import setMinimumWidth [as 别名]
def r_rep_widget(self):
"""
This class creates the figure and instance of the ReducedRepPlot that is used to create the plot in the
top right corner
Parameters
----------
self
Returns
-------
None
"""
figure = plt.figure()
canvas = FigureCanvas(figure)
canvas.mpl_connect('button_press_event', self.click_handling)
FigureCanvas.setSizePolicy(canvas, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(canvas)
canvas.setMinimumWidth(800)
self.rpp = ReducedRepPlot(self.data_dict, self.key_list, 0, 100, 0, 100, "min", figure, canvas)
toolbar = NavigationToolBar(canvas, self)
layout = QtGui.QVBoxLayout()
layout.addWidget(toolbar)
layout.addWidget(canvas)
self.display_box_1.addStretch()
self.display_box_1.addLayout(layout)
示例2: MainWin
# 需要导入模块: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg import setMinimumWidth [as 别名]
#.........这里部分代码省略.........
def startpoint(self,case_id):
voi_val = int(self.voi_cbox.currentText())
vhi_val = int(self.vhi_cbox.currentText())
type_val = str(self.type_cbox.currentText())
case = self.cas.cases[case_id]
if type_val == 'CCl':
idx0 = case.findpoint(tfu=293)
voi = case.statepts[idx0].voi
vhi = case.statepts[idx0].vhi
voi_index = [i for i,v in enumerate(self.voilist) if int(v) == voi][0]
vhi_index = [i for i,v in enumerate(self.vhilist) if int(v) == vhi][0]
self.voi_cbox.setCurrentIndex(voi_index)
self.vhi_cbox.setCurrentIndex(vhi_index)
else:
idx0 = case.findpoint(voi=voi_val,vhi=vhi_val)
return idx0
def create_main_frame(self):
self.main_frame = QWidget()
# Create the mpl Figure and FigCanvas objects.
# 5x4 inches, 100 dots-per-inch
#
self.dpi = 100
self.fig = Figure((6, 5), dpi=self.dpi, facecolor=None)
#self.fig = Figure((6, 5), dpi=self.dpi, facecolor=(1,1,1))
self.canvas = FigureCanvas(self.fig)
self.canvas.mpl_connect('button_press_event',self.on_click)
self.canvas.setParent(self.main_frame)
self.canvas.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
self.canvas.setMinimumWidth(500)
self.canvas.setMinimumHeight(416)
cvbox = QVBoxLayout()
cvbox.addWidget(self.canvas)
canvasGbox = QGroupBox()
canvasGbox.setStyleSheet("QGroupBox { background-color: rgb(200, 200,\
200); border:1px solid gray; border-radius:5px;}")
canvasGbox.setLayout(cvbox)
# Since we have only one plot, we can use add_axes
# instead of add_subplot, but then the subplot
# configuration tool in the navigation toolbar wouldn't
# work.
#
self.axes = self.fig.add_subplot(111)
# Bind the 'pick' event for clicking on one of the bars
#
#self.canvas.mpl_connect('pick_event', self.on_pick)
# Create the navigation toolbar, tied to the canvas
#
#self.mpl_toolbar = NavigationToolbar(self.canvas, self.main_frame)
# Other GUI controls
#
#self.textbox = QLineEdit()
#self.textbox.setMinimumWidth(200)
#self.connect(self.textbox, SIGNAL('editingFinished ()'), self.on_draw)
#self.draw_button = QPushButton("Draw")
示例3: ViewerPlot
# 需要导入模块: from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg import setMinimumWidth [as 别名]
#.........这里部分代码省略.........
is_checkable=True,
is_checked=True,
is_exclusive=True,
receiver=self._on_show_line,
signal_type='toggled')
self.show_hist_action = plot_toolbar.add_action(
text='Show histogram',
icon_name='actions/view-plot-hist-symbolic.svg',
tooltip_text='Show histogram',
is_checkable=True,
is_exclusive=True,
receiver=self._on_show_hist,
signal_type='toggled')
plot_toolbar.addStretch()
# figure
self.figure = Figure()
self._set_figure_background_color()
self.canvas = FigureCanvas(self.figure)
frame = QtGui.QFrame()
frame.setFrameStyle(QtGui.QFrame.StyledPanel)
frame_layout = QtGui.QVBoxLayout()
frame_layout.setContentsMargins(0, 0, 0, 0)
frame.setLayout(frame_layout)
frame_layout.addWidget(self.canvas)
policy = QtGui.QSizePolicy()
policy.setHorizontalStretch(1)
policy.setVerticalStretch(1)
policy.setHorizontalPolicy(QtGui.QSizePolicy.Expanding)
policy.setVerticalPolicy(QtGui.QSizePolicy.Expanding)
self.canvas.setSizePolicy(policy)
self.canvas.setMinimumWidth(300)
self.axes = self.figure.add_subplot(111)
# Figure Layout
layout = QtGui.QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addWidget(plot_toolbar)
layout.addWidget(frame)
# Default navigation toolbar for matplotlib
self.mpl_toolbar = sywidgets.SyNavigationToolbar(self.canvas, self)
layout.addWidget(self.mpl_toolbar)
self.setLayout(layout)
self._update_signal_comboboxes()
self._timeout_after = 500
self._update_plot_timer = QtCore.QTimer(self)
self._update_plot_timer.setInterval(self._timeout_after)
self._update_plot_timer.setSingleShot(True)
self.x_value.currentIndexChanged[int].connect(self._x_selection_changed)
self.y_value.currentIndexChanged[int].connect(self._y_selection_changed)
self.y_value.selectedItemsChanged.connect(self._update_plot_timer.start)
self.resample_value.valueChanged[int].connect(self._resample_value_changed)
self.binning_value.valueChanged.connect(self._binning_value_changed)
self.plot_large_data_check.stateChanged.connect(self._update_plot_timer.start)
self._update_plot_timer.timeout.connect(self._update_plot)
def paintEvent(self, event):
self._draw_canvas()