def __init__(self, *args, **kwargs): """ **Properties** *_axes* (:class:`matplotlib.axes.Axes`): The 2d plot for this widget. """ MatplotlibWidget.__init__(self, *args, **kwargs) #properties{ self._axes = None #} self.setup() self._axes = self.get_axes()[0] self.clear_and_reset_axes()
def __init__(self, *args, **kwargs): """ **Properties** *_axes* (:class:`matplotlib.axes.Axes`): The 2d plot for this widget. *_cmap* (:class:`matplotlib.colors.ListedColormap`) A colormap for the pcolormesh plot. *_settings* (dictionary): A dictionary containing settings as key value pares. """ MatplotlibWidget.__init__(self, *args, **kwargs) self.setup(naviBar=True) self.naviBar.remove_custom_actions() self.combo = QComboBox() self.combo.addItems(["1", "2", "3", "auto"]) # self.combo.addItems(["1", "2", "3"]) self.naviBar.addWidget(self.combo) self.combo.currentIndexChanged.connect(self.settings_changed) self.canvas.mpl_connect("pick_event", self.on_pick) clist = ['w', (0, 0, 1), #blue (0, 0.5, 1), (0, 0.4, 0.7), (0, 0, 0.5), (0, 0, 1), (0.5, 0.25, 0), #orange (1, 0.4, 0), (0.94, 0.4, 0), (0.7, 0.35, 0), (1, 0.5, 0)] #properties{ self._axes = self.get_axes()[0] self._cmap = colors.ListedColormap(clist, N=11) self._settings = {"num_vu":"1"}
def __init__(self, *args, **kwargs): """ **Properties** *_axes* (:class:`mpl_toolkits.mplot3d.Axes3d`): The 3d plot for this widget. *_kwargs* (dictionary): Plot parameters given as (key, value) pares. """ MatplotlibWidget.__init__(self, *args, **kwargs) #properties{ self._axes = None self._kwargs = {"grid":False, "xlabel":"time", "ylabel":"session", "zlabel":"voltage"} #} self.setup((1, 1), False, True) self._axes = self.get_axes()[0] self.clear_and_reset_axes(**self._kwargs)
def __init__(self, *args, **kwargs): """ **Properties** *_axes* (:class:`matplotlib.axes.Axes`): The plot. *_data* (list of tuple of different objects): A list containing the data. The elements are tuple. *_current* (integer): The current slide position. *_movietask* (:class:`MovieTask`): The movie thread or None. *_datatask* (:class:`DataTask`): The data thread or None. *_titles* (dictionary): A dictionary containing the titles for the plot. *shouldLoad* (boolean): Whether or not data should be loaded. *isLoading* (boolean): Whether or not data is currently loading. *vum* (:class:`src.virtualunitmap.VirtualUnitMap`): Is needed for getting the data. *neodata* (:class:`src.neodata.NeoData`): Is needed for getting the data. *_settings* (dictionary): Contains parameters which change the view. *_ylims* (tuple of integer): The y-Axes range. """ MatplotlibWidget.__init__(self, *args, **kwargs) # properties{ self._axes = None self._data = None self._current = 0 self._movietask = None self._datatask = None self._titles = {} self.shouldLoad = False self.isLoading = False self.vum = None self.neodata = None self._settings = {"avRange": 0, "skip": 0, "sps": 1, "time": "original"} self._ylims = (-150, 150) # } self.setup((1, 1), False) self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, self) self.playBtn = QtGui.QPushButton("play", self) self.loadBtn = QtGui.QPushButton("off", self) self.settingsBtn = QtGui.QPushButton("settings", self) w = QtGui.QWidget() self.vgl.addWidget(self.slider, 2, 0, 1, 1) self.vgl.addWidget(self.playBtn, 2, 1, 1, 1) self.vgl.addWidget(w, 0, 1, 1, 1) self.vl = QtGui.QVBoxLayout(w) self.vl.addWidget(self.settingsBtn) self.vl.addWidget(self.loadBtn) self.slider.valueChanged.connect(self.slide) self._axes = self.get_axes()[0] self.playBtn.clicked.connect(self.onPlay) self.settingsBtn.clicked.connect(self.onSettings) self.loadBtn.clicked.connect(self.onLoad) self.slider.setRange(0, 0) self.dia = None self.clear_and_reset_axes()
def __init__(self, *args, **kwargs): """ **Properties** *_axes* (:class:`matplotlib.axes.Axes`): The 2d plot for this widget. *_kwargs* (dictionary): Plot parameters given as (key, value) pares. *_settings* (dictionary): Settings for the plot given as (key, value) pares. """ MatplotlibWidget.__init__(self, *args, **kwargs) #properties{ self._axes = None self._kwargs = {"xlabel":"time", "ylabel":"fraction of spikes"} self._settings = {"binMax":100, "binStep":1} #} self.setup(naviBar=True) #setting up the bin options GUI self.group = QtGui.QGroupBox("Bin options", self) self.group.setFixedWidth(150) self.ggl = QtGui.QGridLayout(self.group) w = QtGui.QWidget() y = QtGui.QWidget() l1 = QtGui.QLabel("bin max:") l2 = QtGui.QLabel("bin step:") self.errorLabel = QtGui.QLabel() self.errorLabel.setStyleSheet("color: rgb(255, 0, 0);") self.ghl1 = QtGui.QHBoxLayout(w) self.ghl2 = QtGui.QHBoxLayout(y) self.binMaxPlusBtn = QtGui.QPushButton("+") self.binMaxEdit = QtGui.QLineEdit() self.binMaxMinusBtn = QtGui.QPushButton("-") self.binStepPlusBtn = QtGui.QPushButton("+") self.binStepEdit = QtGui.QLineEdit() self.binStepMinusBtn = QtGui.QPushButton("-") self.ghl1.addWidget(self.binMaxMinusBtn) self.ghl1.addWidget(self.binMaxEdit) self.ghl1.addWidget(self.binMaxPlusBtn) self.ghl2.addWidget(self.binStepMinusBtn) self.ghl2.addWidget(self.binStepEdit) self.ghl2.addWidget(self.binStepPlusBtn) self.ggl.addWidget(l1) self.ggl.addWidget(w) self.ggl.addWidget(l2) self.ggl.addWidget(y) self.ggl.addWidget(self.errorLabel) #adding the bin options group box to the widget self.vgl.addWidget(self.group, 0, 1, 1, 1) #connect the plus and minus buttons self.binMaxPlusBtn.clicked.connect(self.onMaxPlus) self.binMaxMinusBtn.clicked.connect(self.onMaxMinus) self.binStepPlusBtn.clicked.connect(self.onStepPlus) self.binStepMinusBtn.clicked.connect(self.onStepMinus) #connect the line edits self.binMaxEdit.textChanged.connect(self.binMaxChanged) self.binStepEdit.textChanged.connect(self.binStepChanged) self.binMaxEdit.returnPressed.connect(self.onEnter) self.binStepEdit.returnPressed.connect(self.onEnter) self._axes = self.get_axes()[0] self.clear_and_reset_axes(**self._kwargs) self.init_settings()