Changeset 1021


Ignore:
Timestamp:
04/19/06 11:03:02 (18 years ago)
Author:
mar637
Message:

decimate threshold 1024 -> 2048; added histogram plotting; function documentation updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1018 r1021  
    3737        self._maskselection = None
    3838        self._selection = selector()
    39 
     39        self._hist = None
     40        if rcParams['plotter.histogram']: self._hist = "steps"
     41        else: self._hist = "-"
     42       
    4043    def _translate(self, instr):
    4144        keys = "s b i p t".split()
     
    218221        Set the y-axis label of the plot. If multiple panels are plotted,
    219222        multiple labels have to be specified.
     223        Parameters:
     224            ordinate:    a list of ordinate labels. None (default) let
     225                         data determine the labels
    220226        Example:
    221227             # two panels are visible on the plotter
     
    230236        Set the x-axis label of the plot. If multiple panels are plotted,
    231237        multiple labels have to be specified.
     238        Parameters:
     239            abcissa:     a list of abcissa labels. None (default) let
     240                         data determine the labels
    232241        Example:
    233242             # two panels are visible on the plotter
     
    242251        Set the colors to be used. The plotter will cycle through
    243252        these colors when lines are overlaid (stacking mode).
     253        Parameters:
     254            colormap:     a list of colour names
    244255        Example:
    245256             plotter.set_colors("red green blue")
     
    253264        if self._data: self.plot(self._data)
    254265
     266    def set_histogram(self, hist=True):
     267        """
     268        Enable/Disable histogram-like plotting.
     269        Parameters:
     270            hist:        True (default) or False. The fisrt default
     271                         is taken from the .asaprc setting
     272                         plotter.histogram
     273        """
     274        if hist: self._hist = "steps"
     275        else: self._hist = "-"
     276        if self._data: self.plot(self._data)
     277           
    255278    def set_linestyles(self, linestyles):
    256279        """
     
    441464                    y = y[s:e]
    442465                    m = m[s:e]
    443                 if len(x) > 1024 and True:#rcParams['plotter.decimate']:
    444                     fac = len(x)/1024
     466                if len(x) > 2048 and rcParams['plotter.decimate']:
     467                    fac = len(x)/2048
    445468                    x = x[::fac]
    446469                    m = m[::fac]
     
    455478                        llbl = self._get_label(scan, r, self._stacking, None)
    456479                self._plotter.set_line(label=llbl)
     480                self._plotter.set_line(linestyle=self._hist)
    457481                self._plotter.plot(x,y,m)
    458482                xlim= self._minmaxx or [min(x),max(x)]
Note: See TracChangeset for help on using the changeset viewer.