def __init__(self, *args, **kwargs):
super(PlotSubWindow, self).__init__(*args, **kwargs)
self._plots = []
self._dynamic_axis = None
self._plot_widget = None
self._plot_item = None
self._plots_units = None
self._rois = []
self._measure_rois = []
self._centroid_roi = None
self._is_selected = True
self._layer_items = []
self.disable_errors = False
self.disable_mask = True
dispatch.setup(self)
self._dynamic_axis = DynamicAxisItem(orientation='top')
self._plot_widget = pg.PlotWidget(
axisItems={'top': self._dynamic_axis})
# self.setCentralWidget(self._plot_widget)
self.vertical_layout.insertWidget(0, self._plot_widget)
self._plot_item = self._plot_widget.getPlotItem()
self._plot_item.showAxis('top', True)
# Add grids to the plot
self._plot_item.showGrid(True, True)
self._setup_connections()
self.linelists = []
# Initial color list for this sub window
self._available_colors = cycle(AVAILABLE_COLORS)
# Incorporate event filter
self.installEventFilter(self)
# Create a single vertical line object that can be used to indicate
# wavelength position
self._disp_line = pg.InfiniteLine(movable=True, pen={'color': 'g'})
self._plot_item.addItem(self._disp_line)
# When the user moves the dispersion vertical line, send an event
self._disp_line.sigPositionChanged.connect(lambda:
dispatch.change_dispersion_position.emit(
pos=self._disp_line.value()))
评论列表
文章目录