Ignore:
Timestamp:
03/31/09 12:13:51 (15 years ago)
Author:
Malte Marquarding
Message:

minor doc fixes; fixed list_scans, which seems brokrn in latest ipython; rc parameter xaxisformatting -> axesformatting; fixed font settings for matplotlib rc parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotbase.py

    r1553 r1560  
    1414from asap import rcParams as asaprcParams
    1515from matplotlib.ticker import OldScalarFormatter
    16 from matplotlib.ticker import NullLocator
    1716
    1817# API change in mpl >= 0.98
     
    2019    from matplotlib.transforms import blended_transform_factory
    2120except ImportError:
    22     from matplotlib.transforms import blend_xy_sep_transform  as blended_transform_factory
     21    from matplotlib.transforms import blend_xy_sep_transform as blended_transform_factory
    2322
    2423if int(matplotlib.__version__.split(".")[1]) < 87:
    2524    print "Warning: matplotlib version < 0.87. This might cause errors. Please upgrade."
    26 
    27 #class MyFormatter(OldScalarFormatter):
    28 #    def __call__(self, x, pos=None):
    29 #        last = len(self.locs)-2
    30 #        if pos==0:
    31 #            return ''
    32 #        else: return OldScalarFormatter.__call__(self, x, pos)
    3325
    3426class asaplotbase:
     
    645637                    self.subplots[i]['axes'] = self.figure.add_subplot(rows,
    646638                                                cols, i+1)
    647                     if asaprcParams['plotter.xaxisformatting'] == 'mpl':
     639                    if asaprcParams['plotter.axesformatting'] != 'mpl':
    648640                        self.subplots[i]['axes'].xaxis.set_major_formatter(OldScalarFormatter())
    649641                else:
     
    651643                        self.subplots[i]['axes'] = self.figure.add_subplot(rows,
    652644                                                cols, i+1)
    653                         if asaprcParams['plotter.xaxisformatting'] != 'mpl':
     645                        if asaprcParams['plotter.axesformatting'] != 'mpl':
    654646                           
    655647                            self.subplots[i]['axes'].xaxis.set_major_formatter(OldScalarFormatter())
     
    733725                        sp['axes'].legend((' '))
    734726
     727
    735728            from matplotlib.artist import setp
    736             fp = FP(size=rcParams['xtick.labelsize'])
    737             xts = fp.get_size_in_points()- (self.cols)/2
    738             fp = FP(size=rcParams['ytick.labelsize'])
    739             yts = fp.get_size_in_points() - (self.rows)/2
     729            fpx = FP(size=rcParams['xtick.labelsize'])
     730            xts = fpx.get_size_in_points()- (self.cols)/2
     731            fpy = FP(size=rcParams['ytick.labelsize'])
     732            yts = fpy.get_size_in_points() - (self.rows)/2
     733            fpa = FP(size=rcParams['axes.labelsize'])
     734            fpat = FP(size=rcParams['axes.titlesize'])
     735            axsize =  fpa.get_size_in_points()
     736            tsize =  fpat.get_size_in_points()
    740737            for sp in self.subplots:
    741738                ax = sp['axes']
    742                 s = ax.title.get_size()
    743                 tsize = s-(self.cols+self.rows)
    744                 ax.title.set_size(tsize)
    745                 fp = FP(size=rcParams['axes.labelsize'])
     739                off = 0
     740                if len(self.subplots) > 1:
     741                    off = self.cols+self.rows
     742                ax.title.set_size(tsize-off)
    746743                setp(ax.get_xticklabels(), fontsize=xts)
    747744                setp(ax.get_yticklabels(), fontsize=yts)
    748                 origx =  fp.get_size_in_points()
    749                 origy = origx
    750745                off = 0
    751                 if self.cols > 1: off = self.cols
    752                 xfsize = origx-off
    753                 ax.xaxis.label.set_size(xfsize)
    754                 off = 0
    755                 if self.rows > 1: off = self.rows
    756                 yfsize = origy-off
    757                 ax.yaxis.label.set_size(yfsize)
     746                if self.cols > 1:
     747                    off = self.cols
     748                ax.xaxis.label.set_size(axsize-off)
     749                if self.rows > 1:
     750                    off = self.rows
     751                ax.yaxis.label.set_size(axsize-off)
    758752
    759753    def subplot(self, i=None, inc=None):
Note: See TracChangeset for help on using the changeset viewer.