本文整理汇总了Python中matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasQTAgg.__init__方法的具体用法?Python FigureCanvasQTAgg.__init__怎么用?Python FigureCanvasQTAgg.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg
的用法示例。
在下文中一共展示了FigureCanvasQTAgg.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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 __init__ [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 = []
示例3: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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 __init__ [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)
示例5: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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)
示例6: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [as 别名]
def __init__(self):
self.fig = Figure()
FigureCanvas.__init__(self, self.fig)
self.main_plot = None
self.create_main_plot()
示例7: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [as 别名]
def __init__(self, subplot=111, parent=None, width=5, height=4, dpi=100,
figfacecolor=3*[0.941], style=None, **kwargs):
# super(MplCanvas, self).__init__(parent)
if style is None:
pass
else:
_mpl.style.use(style)
# Create figure and axes
self.fig = _Figure(figsize=(width, height), dpi=dpi,
facecolor=figfacecolor, **kwargs)
# Initialize the canvas
FigureCanvas.__init__(self, self.fig)
self.setParent(parent)
self.setupAx(subplot=subplot, **kwargs)
# Not really used, but could be used to have some sort of initial plot
self.compute_initial_figure()
# Set canvas size policies and geometry
FigureCanvas.setSizePolicy(self, _QtWidgets.QSizePolicy.Expanding,
_QtWidgets.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
# Create the toolbar and connect to canvas (self)
self.toolbar = _NavigationToolbar(self, None)
示例8: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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
示例9: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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)
示例10: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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)
示例11: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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
示例12: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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)
示例13: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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
示例14: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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
示例15: __init__
# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import __init__ [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