Changeset 1096


Ignore:
Timestamp:
07/31/06 12:20:00 (18 years ago)
Author:
mar637
Message:

added legend placing/disable to set_legend. Changed decimate from 2048 to 1024

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1087 r1096  
    181181        return
    182182
    183     def set_legend(self, mp=None):
     183    def set_legend(self, mp=None, mode = 0):
    184184        """
    185185        Specify a mapping for the legend instead of using the default
    186186        indices:
    187187        Parameters:
    188              mp:    a list of 'strings'. This should have the same length
     188            mp:    a list of 'strings'. This should have the same length
    189189                    as the number of elements on the legend and then maps
    190190                    to the indeces in order. It is possible to uses latex
    191191                    math expression. These have to be enclosed in r'', e.g. r'$x^{2}$'
     192            mode:   where to display the legend
     193                    Any other value for loc else disables the legend:
     194                        0: auto
     195                        1: upper right
     196                        2: upper left
     197                        3: lower left
     198                        4: lower right
     199                        5: right
     200                        6: center left
     201                        7: center right
     202                        8: lower center
     203                        9: upper center
     204                        10: center
    192205
    193206        Example:
     
    200213        """
    201214        self._lmap = mp
    202         if self._data: self.plot(self._data)
     215        self._plotter.legend(mode)
     216        if self._data:
     217            self.plot(self._data)
    203218        return
    204219
     
    461476                    x = x[s:e]
    462477                    y = y[s:e]
    463                 if len(x) > 2048 and rcParams['plotter.decimate']:
    464                     fac = len(x)/2048
     478                if len(x) > 1024 and rcParams['plotter.decimate']:
     479                    fac = len(x)/1024
    465480                    x = x[::fac]
    466481                    y = y[::fac]
Note: See TracChangeset for help on using the changeset viewer.