def __init__(self, data, x, y, slice_idx, cmap=P.cm.gray, norm=None, interpolation="bilinear", extent=None): self.norm = norm self.cmap = cmap self.interpolation = interpolation self.slice_idx = slice_idx # extent should be static, so set it and leave it alone if not extent: y, x = data.shape[-2:] extent = [-x / 2., x / 2., -y / 2., y / 2.] self.extent = extent self.ylim = tuple(extent[2:]) self.xlim = tuple(extent[:2]) fig = P.Figure(figsize=P.figaspect(data), dpi=80) ax = fig.add_subplot(111) ax.yaxis.tick_right() ax.title.set_y(1.05) FigureCanvas.__init__(self, fig) self.setData(data) self._init_crosshairs(x, y)
def __init__(self,src,model,state): self.src = src self.model = model self.__state = state state.connect('selection-changed',self.update_spanner) state.connect('selection-removed',self.remove_spanner) xb = src.get_time_bounds() yb = src.get_data_bounds() figure = Figure(dpi=100) self.plot = figure.add_subplot(111,xbound=xb,ybound=yb,autoscale_on=False) self.plot.plot_date(src.get_time(True),src.get_data(True),'-') if state.selection is None: self.spanner = None else: vall,valr = state.selection self.spanner = self.plot.axvspan(vall,valr,alpha=0.5) self.ctx_spanners = dict() FigureCanvas.__init__(self,figure) self.mpl_connect('button_press_event',self.on_press) self.mpl_connect('button_release_event',self.on_release) self.mpl_connect('motion_notify_event',self.on_move) model.connect('annotation-added',self.notice_annotation) model.connect('annotation-removed',self.notice_annotation_removal) model.connect('annotation-changed',self.notice_annotation_change) for (id,color,boundl,boundr) in model.annotations(): self.notice_annotation(model,id,color,boundl,boundr)
def __init__(self,t_from,t_to): self.figure = Figure(figsize=(10,2), dpi=80) self.t_from = t_from self.t_to = t_to self.t_diff = math.fabs(t_from - t_to) self.axis = None FigureCanvas.__init__(self,self.figure)
def __init__(self, t_from, t_to): self.figure = Figure(figsize=(10, 2), dpi=80) self.t_from = t_from self.t_to = t_to self.t_diff = math.fabs(t_from - t_to) self.axis = None FigureCanvas.__init__(self, self.figure)
def __init__(self): self._fig = Figure() FigureCanvas.__init__(self, self._fig) self._data = N.zeros((200, 320), dtype=N.uint8) self._dims = self._data.shape self._cmap = None self._rotate = 0 self._hud = dict() self._hud_text = self._fig.text(0.99, 0.99, '', color='white', verticalalignment='top', horizontalalignment='right') self._overlays = dict() # Draw the image self._ax = self._fig.add_subplot(1, 1, 1) self._image = self._ax.imshow(self._data, cmap=matplotlib.cm.gray) self._ax.set_aspect('equal') self._fig.tight_layout() self.draw()
def __init__(self, data, x, y, slice_idx, cmap=P.cm.gray, norm=None, interpolation="bilinear", extent=None): self.norm = norm self.cmap = cmap self.interpolation=interpolation self.slice_idx = slice_idx # extent should be static, so set it and leave it alone if not extent: y,x = data.shape[-2:] extent = [-x/2., x/2., -y/2., y/2.] self.extent = extent self.ylim = tuple(extent[2:]) self.xlim = tuple(extent[:2]) fig = P.Figure(figsize=P.figaspect(data), dpi=80) ax = fig.add_subplot(111) ax.yaxis.tick_right() ax.title.set_y(1.05) FigureCanvas.__init__(self, fig) self.setData(data) self._init_crosshairs(x, y)
def __init__(self): self.figure = Figure(figsize=(10,2), dpi=80) FigureCanvas.__init__(self)
def __init__(self): self.figure = Figure(figsize=(10, 2), dpi=80) FigureCanvas.__init__(self)