def __init__(self, canvas, frame, name=None): """ Create a new toolbar object Parameters ---------- canvas : Maptloblib canvas instance The drawing canvas to interact with frame : QWidget The QT frame that the canvas is embedded within. """ self.buttons = {} self.__active = None self.basedir = None NavigationToolbar2QT.__init__(self, canvas, frame) if name is not None: self.setWindowTitle(name) self.setIconSize(QtCore.QSize(25, 25)) self.layout().setSpacing(1) self.setFocusPolicy(Qt.StrongFocus) self._idKey = None # pyside is prone to segfaults if slots hold the only # reference to a signal, so we hold an extra reference # see https://bugreports.qt-project.org/browse/PYSIDE-88 self.__signals = []
def __init__(*args, **kwargs): warnings.warn( 'This class has been deprecated in 1.4 ' + 'as it has no additional functionality over ' + '`NavigationToolbar2QT`. Please change your code to ' 'use `NavigationToolbar2QT` instead', mplDeprecation) NavigationToolbar2QT.__init__(*args, **kwargs)
def __init__(self , canvas , parent , direction = 'h' ) : self.canvas = canvas QtWidgets.QWidget.__init__( self, parent ) if direction=='h' : self.layout = PyQt5.QtWidgets.QHBoxLayout else : self.layout = PyQt5.QtWidgets.QVBoxLayout NavigationToolbar.__init__( self, canvas, parent )
def __init__(self, parent, canvas, direction = 'h' ) : self.canvas = canvas QWidget.__init__( self, parent ) if direction=='h' : self.layout = QHBoxLayout( self ) else : self.layout = QVBoxLayout( self ) self.layout.setMargin( 2 ) self.layout.setSpacing( 0 ) NavigationToolbar.__init__( self, canvas )
def __init__(self, canvas, parent, coordinates=True): self.curveX = {} self.curveY = {} self.error = 0.01 self.curve_point = {} self.last_plot = {} self.siblings = [] self.text_coordinates = u'' self.last_message = u'' self.canvas = canvas self._drag_mode = False NavigationToolbar2QT.__init__(self, canvas, parent, coordinates) self._id_scroll_event = self.canvas.mpl_connect('scroll_event', self._on_mouse_scroll) self._id_mouse_button_release = self.canvas.mpl_connect('button_release_event', self._on_mouse_button_release)
def __init__(self, figure_canvas,axes_canvas, parent= None): self.toolitems = (('Home', 'Reset', 'home', 'home'), ('Pan', 'Pan', 'move', 'pan'), ('Zoom', 'Zoom', 'zoom_to_rect', 'zoom'), (None, None, None, None), ('Transect', 'make a transect',os.path.join(root_path,'icons','transect'), 'transect_tool'), ('View', 'Switch view',os.path.join(root_path,'icons','switch'), 'switch_view'), ('Selector', 'Select node', os.path.join(root_path,'icons','select'), 'select_tool'), (None, None, None, None), ('Save', 'Save', 'filesave', 'save_figure')) #('Subplots', 'putamus parum claram', 'subplots', 'configure_subplots'), self.figure_canvas=figure_canvas self.axes_canvas=axes_canvas NavigationToolbar.__init__(self, figure_canvas, parent= parent)
def __init__(self, canvas, parent): NavigationToolbar2QT.__init__(self, canvas, parent) self.parent = parent # we assume it has a vCollection self.editCheckBox = QW.QCheckBox("Edit mode") self.addWidget(self.editCheckBox) editTypes = ["Add LMB/Delete RMB", "Move"] self.editTypeComboBox = QW.QComboBox() self.editTypeComboBox.addItems(editTypes) self.addWidget(self.editTypeComboBox) self.selectedLabel = QW.QLabel("Chosen points:") self.addWidget(self.selectedLabel) self.selectedPointsComboBox = QW.QComboBox() self.addWidget(self.selectedPointsComboBox)
def __init__(self, canvas, parent): NavigationToolbar2QT.__init__(self, canvas, parent) self.parent = parent # we assume it has a vCollection self.editCheckBox = QW.QCheckBox("Tryb edycji") self.addWidget(self.editCheckBox) editTypes = ["Dodaj LPM/Usuń PPM", "Przesuń"] self.editTypeComboBox = QW.QComboBox() self.editTypeComboBox.addItems(editTypes) self.addWidget(self.editTypeComboBox) self.selectedLabel = QW.QLabel("Wybrane punkty:") self.addWidget(self.selectedLabel) self.selectedPointsComboBox = QW.QComboBox() self.addWidget(self.selectedPointsComboBox)
def __init__(self, canvas, parent): NavigationToolbar.__init__(self, canvas, parent) self.clearButtons = [] # Search through existing buttons nextB = None not_in = ('Subplots', 'Customize') for c in self.findChildren(QtWidgets.QToolButton): if nextB is None: nextB = c # Don't want to see subplots and customize if str(c.text()) in not_in: c.defaultAction().setVisible(False) continue # Need to keep track of pan and zoom buttons # Also grab toggled event to clear checked status of picker button if str(c.text()) in ('Pan', 'Zoom'): self.clearButtons.append(c) nextB = None
def __init__(self, canvas, parent, coordinates=True): NavigationToolbar2QT.__init__(self, canvas, parent, coordinates=True) self.axes = self.parent.axes self.N = 1000 self.t = [] self.V = [] self.ch_n = [] self.fn = [] self.Ncontrol = QtWidgets.QLineEdit(self) self.Ncontrol.setValidator(QtGui.QIntValidator(self.Ncontrol)) self.Ncontrol.setFixedWidth(50) self.Ncontrol.setText(str(self.N)) self.Nlabel = QtWidgets.QLabel('Data points on Fig, N=', self) self.refr = QtWidgets.QPushButton(QtGui.QIcon('refresh.png'), None, self) self.refr.clicked.connect(self.getN) self.addWidget(self.Nlabel) self.addWidget(self.Ncontrol) self.addWidget(self.refr)
def __init__(self, canvas, parent, coordinates=False): NavigationToolbar2QT.__init__(self, canvas, parent, coordinates) self.setIconSize(QtCore.QSize(20, 20)) self.calling_function = None
def __init__(self, canvas, parent, coordinates=True): NavigationToolbar2QT.__init__(self, canvas, parent, coordinates) self.zoom_callbacks = []
def __init__(self, graph, plotWindow): NavigationToolbar2QT.__init__(self, graph, plotWindow) self._nav_stack = NStack()
def __init__(self,canvas, parent): NavigationToolbar2QT.__init__(self, canvas, parent)
def __init__(self, canvas, parent=None, coordinates=True): NavigationToolbar.__init__(self, canvas, parent, coordinates) self.colors = {'ly': '#7affce', 'mark': '#ffac7c'} self.markSet = MarkerSet(self.colors['mark'])
def __init__(self, canvas, parent): NavigationToolbar2QT.__init__(self, canvas, parent)