本文整理汇总了Python中matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.updateGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.updateGeometry方法的具体用法?Python FigureCanvasQTAgg.updateGeometry怎么用?Python FigureCanvasQTAgg.updateGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg
的用法示例。
在下文中一共展示了FigureCanvasQTAgg.updateGeometry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [as 别名]
def __init__(self):
self.fig = Figure()
FigureCanvas.__init__(self, self.fig)
FigureCanvas.setSizePolicy(self,
QSizePolicy.Expanding,
QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
示例2: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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)
示例3: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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)
示例4: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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
示例5: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [as 别名]
def __init__(self, parent=None, width=5, height=4, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = fig.add_subplot(111)
# We want the axes cleared every time plot() is called
self.axes.hold(False)
self.compute_initial_figure()
#
FigureCanvas.__init__(self, fig)
self.setParent(parent)
self.setStyleSheet("{background-color:transparent;border:none;}")
"""FigureCanvas.setSizePolicy(self,
QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Expanding)"""
FigureCanvas.updateGeometry(self)
self.tootlbar = NavigationToolbar(self, parent)
self.tootlbar.hide()
self.fid = 0
self.data = []
self.index = []
示例6: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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)
示例7: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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
示例8: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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)
示例9: Statistics
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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 = []
示例10: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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
示例11: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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)
示例12: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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
示例13: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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
示例14: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [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)
示例15: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import updateGeometry [as 别名]
def __init__(self, parent=None,
width=4, height=3, dpi=100,
use_seaborn=False,
style=0, context=0):
self.seaborn = use_seaborn
if use_seaborn:
import seaborn as sns
sns.set_style(self.SEABORN_STYLE[style])
sns.set_context(self.SEABORN_CONTEXT[context])
# set matplitlib figure object
self.fig = Figure(figsize=(width, height), dpi=int(dpi))
self.axes = self.fig.add_subplot(111)
self.axes.hold(True)
# call constructor of FigureCanvas
super(Figurecanvas, self).__init__(self.fig)
self.setParent(parent)
# expand plot area as large as possible
FigureCanvas.setSizePolicy(self,
QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
self.x_min = 0
self.x_max = 30
# set color map object
self.__cm = matplotlib.cm.gist_rainbow