def plottable_selected(self, id): PlotPanel.plottable_selected(self, id) if id is not None: self.parent.SetStatusText("Hovering over %s" % self.graph.selected_plottable) else: self.parent.SetStatusText("")
def onFitting(self, event): if self.graph.selected_plottable is not None: if self.plots[self.graph. selected_plottable].__class__.__name__ == 'Data1D': PlotPanel.onFitting(self, event) else: self.parent.SetStatusText("Can't fit a theory curve")
def __init__(self, parent, id=-1, color=None, dpi=None, **kwargs): PlotPanel.__init__(self, parent, id=id, color=color, dpi=dpi, **kwargs) # Keep track of the parent Frame self.parent = parent # Internal list of plottable names (because graph # doesn't have a dictionary of handles for the plottables) self.plots = {}
def __init__(self, parent, id=-1, dimension=2, color=None, dpi=None, **kwargs): """ """ PlotPanel.__init__(self, parent, id=id, color=color, dpi=dpi, **kwargs) # Keep track of the parent Frame self.parent = parent # Internal list of plottable names (because graph # doesn't have a dictionary of handles for the plottables) self.dimension = dimension self.plots = {} self.graph = Graph() # add axis labels self.graph.xaxis('\\rm{x} ', '') self.graph.yaxis('\\rm{y} ', '')
def __init__(self, parent, id=-1, is_number=False, content='?', **kwargs): """ """ PlotPanel.__init__(self, parent, id=id, **kwargs) self.is_number = is_number self.content = content self.point = None self.position = (0.4, 0.5) self.scale = 'linear' self.prevXtrans = "x" self.prevYtrans = "y" self.viewModel = "--" self.subplot.set_xticks([]) self.subplot.set_yticks([]) self.add_text() self.figure.subplots_adjust(left=0.1, bottom=0.1)
def __init__(self, parent, id= -1, is_number=False, content='?', **kwargs): """ """ PlotPanel.__init__(self, parent, id=id, **kwargs) self.is_number = is_number self.content = content self.point = None self.position = (0.4, 0.5) self.scale = 'linear' self.prevXtrans = "x" self.prevYtrans = "y" self.viewModel = "--" self.subplot.set_xticks([]) self.subplot.set_yticks([]) self.add_text() self.figure.subplots_adjust(left=0.1, bottom=0.1)
def onLeftDown(self, event): """ left button down and ready to drag """ # Check that the LEFT button was pressed PlotPanel.onLeftDown(self, event) ax = event.inaxes if ax != None: # data coordinate position pos_x = "%8.3g" % event.xdata pos_y = "%8.3g" % event.ydata position = "x: %s y: %s" % (pos_x, pos_y) wx.PostEvent(self.parent, StatusEvent(status=position)) self.plottable_selected(self.data2D.id) self._manager.set_panel_on_focus(self) wx.PostEvent(self.parent, PanelOnFocusEvent(panel=self))
def __init__(self, d_min, d_max, parent, id= -1, color=None, \ dpi=None, style=wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs): """ Initialization. The parameters added to PlotPanel are: :param d_min: Minimum value of D_max to explore :param d_max: Maximum value of D_max to explore """ PlotPanel.__init__(self, parent, id=id, style=style, **kwargs) self.parent = parent self.min = d_min self.max = d_max self.npts = DEFAULT_NPTS step = (self.max - self.min) / (self.npts - 1) self.x = numpy.arange(self.min, self.max + step * 0.01, step) dx = numpy.zeros(len(self.x)) y = numpy.ones(len(self.x)) dy = numpy.zeros(len(self.x)) # Plot area self.plot = Model1D(self.x, y=y, dy=dy) self.plot.name = DEFAULT_OUTPUT self.plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM # Graph self.graph = Graph() self.graph.xaxis("\\rm{D_{max}}", 'A') self.graph.yaxis("\\rm{%s}" % DEFAULT_OUTPUT, "") self.graph.add(self.plot) self.graph.render(self) self.toolbar.DeleteToolByPos(0) self.toolbar.DeleteToolByPos(8) self.toolbar.Realize()
def onFitting(self, event): if self.graph.selected_plottable is not None: if self.plots[self.graph.selected_plottable].__class__.__name__ == "Data1D": PlotPanel.onFitting(self, event) else: self.parent.SetStatusText("Can't fit a theory curve")