Example #1
0
    def __init__(self, parent, axes=[], id=-1, color=None, dpi=None, **kwargs):
        """
        """
        PlotPanel.__init__(self, parent, id=id, xtransform='x', ytransform='y',
                           color=color, dpi=dpi,
                           size=(_STATICBOX_WIDTH, PANEL_SIZE - 100), **kwargs)

        # Keep track of the parent Frame
        self.parent = parent
        self.window_name = "Scattering Length Density Profile"
        self.window_caption = self.window_name
        self.prevXtrans = "x"
        self.prevYtrans = "y"
        self.viewModel = "--"
        # Internal list of plottable names (because graph
        # doesn't have a dictionary of handles for the plottables)
        self.plots = {}
        self.graph = Graph()
        self.axes_label = []
        for idx in range(0, len(axes)):
            self.axes_label.append(axes[idx])
        self.xaxis_label = ''
        self.xaxis_unit = ''
        self.yaxis_label = ''
        self.yaxis_unit = ''
        self.resizing = True
        self.xcolor = 'black'
        self.ycolor = 'black'
Example #2
0
    def __init__(self, parent, id=-1, data2d=None, color=None,
                 dpi=None, style=wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
        """
        Initialize the panel
        """
        ModelPanel1D.__init__(self, parent, id=id, style=style, **kwargs)
        self.parent = parent
        ## Reference to the parent window
        if hasattr(parent, "parent"):
            self.parent = self.parent.parent
        ## Dictionary containing Plottables
        self.plots = {}
        ## Save reference of the current plotted
        self.data2D = data2d
        ## Unique ID (from gui_manager)
        self.uid = None
        ## Action IDs for internal call-backs
        self.action_ids = {}
        ## Create Artist and bind it
        self.connect = BindArtist(self.subplot.figure)
        ## Beam stop
        self.beamstop_radius = DEFAULT_BEAM
        ## to set the order of lines drawn first.
        self.slicer_z = 5
        ## Reference to the current slicer
        self.slicer = None
        ## event to send slicer info
        self.Bind(EVT_INTERNAL, self._onEVT_INTERNAL)

        self.axes_frozen = False
        ## panel that contains result from slicer motion (ex: Boxsum info)
        self.panel_slicer = None
        self.title_label = None
        self.title_font = None
        self.title_color = 'black'
        ## Graph
        self.graph = Graph()
        self.graph.xaxis("\\rm{Q}", 'A^{-1}')
        self.graph.yaxis("\\rm{Intensity} ", "cm^{-1}")
        self.graph.render(self)
        ## store default value of zmin and zmax
        self.default_zmin_ctl = self.zmin_2D
        self.default_zmax_ctl = self.zmax_2D