Ignore:
Timestamp:
12/17/12 19:38:05 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: No (just changed the order of methods)

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s):

Description:

No actual change to codes.
Just changed the order of methods for future modifications.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r2699 r2700  
    655655        return
    656656
     657    def set_histogram(self, hist=True, linewidth=None, refresh=True):
     658        """
     659        Enable/Disable histogram-like plotting.
     660        Parameters:
     661            hist:        True (default) or False. The fisrt default
     662                         is taken from the .asaprc setting
     663                         plotter.histogram
     664            linewidth:   a line width
     665            refresh:     True (default) or False. If True, the plot is
     666                         replotted based on the new parameter setting(s).
     667                         Otherwise,the parameter(s) are set without replotting.
     668        """
     669        self._hist = hist
     670        if isinstance(linewidth, float) or isinstance(linewidth, int):
     671            from matplotlib import rc as rcp
     672            rcp('lines', linewidth=linewidth)
     673        if refresh and self._data: self.plot(self._data)
     674
    657675    def set_colors(self, colmap, refresh=True):
    658676        """
     
    678696    # alias for english speakers
    679697    set_colours = set_colors
    680 
    681     def set_histogram(self, hist=True, linewidth=None, refresh=True):
    682         """
    683         Enable/Disable histogram-like plotting.
    684         Parameters:
    685             hist:        True (default) or False. The fisrt default
    686                          is taken from the .asaprc setting
    687                          plotter.histogram
    688             linewidth:   a line width
    689             refresh:     True (default) or False. If True, the plot is
    690                          replotted based on the new parameter setting(s).
    691                          Otherwise,the parameter(s) are set without replotting.
    692         """
    693         self._hist = hist
    694         if isinstance(linewidth, float) or isinstance(linewidth, int):
    695             from matplotlib import rc as rcp
    696             rcp('lines', linewidth=linewidth)
    697         if refresh and self._data: self.plot(self._data)
    698698
    699699    def set_linestyles(self, linestyles=None, linewidth=None, refresh=True):
     
    921921            self._maskselection = None
    922922        if refresh: self.plot(self._data)
    923 
    924     def _slice_indeces(self, data):
    925         mn = self._minmaxx[0]
    926         mx = self._minmaxx[1]
    927         asc = data[0] < data[-1]
    928         start=0
    929         end = len(data)-1
    930         inc = 1
    931         if not asc:
    932             start = len(data)-1
    933             end = 0
    934             inc = -1
    935         # find min index
    936         #while start > 0 and data[start] < mn:
    937         #    start+= inc
    938         minind=start
    939         for ind in xrange(start,end+inc,inc):
    940             if data[ind] > mn: break
    941             minind=ind
    942         # find max index
    943         #while end > 0 and data[end] > mx:
    944         #    end-=inc
    945         #if end > 0: end +=1
    946         maxind=end
    947         for ind in xrange(end,start-inc,-inc):
    948             if data[ind] < mx: break
    949             maxind=ind
    950         start=minind
    951         end=maxind
    952         if start > end:
    953             return end,start+1
    954         elif start < end:
    955             return start,end+1
    956         else:
    957             return start,end
    958923
    959924
     
    13001265        return userlabel or d[mode]
    13011266
     1267    def _slice_indeces(self, data):
     1268        mn = self._minmaxx[0]
     1269        mx = self._minmaxx[1]
     1270        asc = data[0] < data[-1]
     1271        start=0
     1272        end = len(data)-1
     1273        inc = 1
     1274        if not asc:
     1275            start = len(data)-1
     1276            end = 0
     1277            inc = -1
     1278        # find min index
     1279        #while start > 0 and data[start] < mn:
     1280        #    start+= inc
     1281        minind=start
     1282        for ind in xrange(start,end+inc,inc):
     1283            if data[ind] > mn: break
     1284            minind=ind
     1285        # find max index
     1286        #while end > 0 and data[end] > mx:
     1287        #    end-=inc
     1288        #if end > 0: end +=1
     1289        maxind=end
     1290        for ind in xrange(end,start-inc,-inc):
     1291            if data[ind] < mx: break
     1292            maxind=ind
     1293        start=minind
     1294        end=maxind
     1295        if start > end:
     1296            return end,start+1
     1297        elif start < end:
     1298            return start,end+1
     1299        else:
     1300            return start,end
     1301
    13021302    def plotazel(self, scan=None, outfile=None):
    13031303        """
Note: See TracChangeset for help on using the changeset viewer.