Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotbase.py

    r1836 r1946  
    1414
    1515from asap.parameters import rcParams as asaprcParams
    16 from asap.logging import asaplog, print_log
     16from asap.logging import asaplog
    1717
    1818# API change in mpl >= 0.98
     
    2525    #print "Warning: matplotlib version < 0.87. This might cause errors. Please upgrade."
    2626    asaplog.push( "matplotlib version < 0.99. This might cause errors. Please upgrade." )
    27     print_log( 'WARN' )
     27    asaplog.post( 'WARN' )
    2828
    2929class asaplotbase:
     
    417417            fname = 'asap'+dstr+'.png'
    418418
    419         d = ['png','.ps','eps']
     419        d = ['png','.ps','eps', 'svg']
    420420
    421421        from os.path import expandvars
     
    456456            except IOError, msg:
    457457                #print 'Failed to save %s: Error msg was\n\n%s' % (fname, err)
    458                 print_log()
     458                asaplog.post()
    459459                asaplog.push('Failed to save %s: Error msg was\n\n%s' % (fname, str(msg)))
    460                 print_log( 'ERROR' )
     460                asaplog.post( 'ERROR' )
    461461                return
    462462        else:
     
    464464            #print "'ps', 'eps', 'png'"
    465465            asaplog.push( "Invalid image type. Valid types are:" )
    466             asaplog.push( "'ps', 'eps', 'png'" )
    467             print_log('WARN')
     466            asaplog.push( "'ps', 'eps', 'png', 'svg'" )
     467            asaplog.post('WARN')
    468468
    469469
     
    669669                            for tick in self.subplots[i]['axes'].xaxis.majorTicks:
    670670                                tick.label1On = False
    671                             self.subplots[i]['axes'].xaxis.label.set_visible(False)
     671                            #self.subplots[i]['axes'].xaxis.label.set_visible(False)
    672672                    if i%cols:
    673673                        # Suppress y-labels for frames not in the left column.
    674674                        for tick in self.subplots[i]['axes'].yaxis.majorTicks:
    675675                            tick.label1On = False
    676                         self.subplots[i]['axes'].yaxis.label.set_visible(False)
     676                        #self.subplots[i]['axes'].yaxis.label.set_visible(False)
    677677                    # disable the first tick of [1:ncol-1] of the last row
    678678                    #if i+1 < nplots:
    679679                    #    self.subplots[i]['axes'].xaxis.majorTicks[0].label1On = False
    680                 self.rows = rows
    681                 self.cols = cols
     680                # set axes label state for interior subplots.
     681                if i%cols:
     682                    self.subplots[i]['axes'].yaxis.label.set_visible(False)
     683                if (i <= (rows-1)*cols - 1) and (i+cols < nplots):
     684                    self.subplots[i]['axes'].xaxis.label.set_visible(False)
     685            self.rows = rows
     686            self.cols = cols
    682687            self.subplot(0)
    683688        del rows,cols,n,nplots,layout,ganged,i
     689
    684690
    685691    def tidy(self):
     
    694700                if i != 0:
    695701                    ax.yaxis.majorTicks[-1].label1On = False
    696 
     702            ## set axes label state for interior subplots.
     703            #innerax=False
     704            #if i%self.cols:
     705            #    ax.yaxis.label.set_visible(innerax)
     706            #if (i <= (self.rows-1)*self.cols - 1) and (i+self.cols < nplots):
     707            #    ax.xaxis.label.set_visible(innerax)
     708           
    697709
    698710    def set_title(self, title=None):
     
    733745                        sp['axes'].legend(tuple(lines), tuple(labels),
    734746                                          self.loc, prop=fp)
    735                     else:
    736                         sp['axes'].legend((' '))
     747                    #else:
     748                    #    sp['axes'].legend((' '))
    737749
    738750            from matplotlib.artist import setp
Note: See TracChangeset for help on using the changeset viewer.