source: issm/oecreview/Archive/21337-21723/ISSM-21425-21426.diff@ 21726

Last change on this file since 21726 was 21726, checked in by Mathieu Morlighem, 8 years ago

CHG added Archive/21337-21723

File size: 2.1 KB
  • ../trunk-jpl/src/m/plot/plotmodel.py

     
    55try:
    66        import pylab as p
    77        import matplotlib.pyplot as plt
    8         from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid
     8        from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid
    99except ImportError:
    1010        print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
    1111
     
    1616        '''     at command prompt, type 'plotdoc()' for additional documentation
    1717        '''
    1818
    19         #First process options 
     19        #First process options
    2020        options=plotoptions(*args)
    2121
    2222        #get number of subplots
     
    3535        else:
    3636                nrows=np.ceil(numberofplots/subplotwidth)
    3737                nr=False
    38        
     38
    3939        if options.list[0].exist('ncols'):
    4040                ncols=options.list[0].getfieldvalue('ncols')
    4141                nc=True
     
    4444                nc=False
    4545        ncols=int(ncols)
    4646        nrows=int(nrows)
    47        
     47
    4848        #check that nrows and ncols were given at the same time!
    4949        if not nr==nc:
    5050                raise StandardError('error: nrows and ncols need to be specified together, or not at all')
    51        
     51
    5252        #Go through plots
    5353        if numberofplots:
    5454                #if plt.fignum_exists(figurenumber):
     
    8181                cbar_location=options.list[0].getfieldvalue('colorbarpos','right') # right,top
    8282                cbar_size=options.list[0].getfieldvalue('colorbarsize','5%')
    8383                cbar_pad=options.list[0].getfieldvalue('colorbarpad','2.5%') # None or %
    84                
     84
    8585                axgrid=ImageGrid(fig, 111,
    8686                                nrows_ncols=(nrows,ncols),
    8787                                ngrids=plotnum,
  • ../trunk-jpl/src/m/plot/plot_unit.py

     
    2828        # }}}
    2929        # {{{ define wich colormap to use
    3030        try:
    31                 defaultmap=plt.cm.get_cmap('viridis')
     31                defaultmap=plt.cm.get_cmap('viridis',colorlevels)
    3232        except AttributeError:
    3333                print("Viridis can't be found (probably too old Matplotlib) reverting to gnuplot colormap")
    3434                defaultmap=truncate_colormap('gnuplot2',0.1,0.9,colorlevels)
Note: See TracBrowser for help on using the repository browser.