source:
issm/oecreview/Archive/21337-21723/ISSM-21425-21426.diff@
21726
Last change on this file since 21726 was 21726, checked in by , 8 years ago | |
---|---|
File size: 2.1 KB |
-
../trunk-jpl/src/m/plot/plotmodel.py
5 5 try: 6 6 import pylab as p 7 7 import matplotlib.pyplot as plt 8 8 from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid 9 9 except ImportError: 10 10 print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled" 11 11 … … 16 16 ''' at command prompt, type 'plotdoc()' for additional documentation 17 17 ''' 18 18 19 #First process options 19 #First process options 20 20 options=plotoptions(*args) 21 21 22 22 #get number of subplots … … 35 35 else: 36 36 nrows=np.ceil(numberofplots/subplotwidth) 37 37 nr=False 38 38 39 39 if options.list[0].exist('ncols'): 40 40 ncols=options.list[0].getfieldvalue('ncols') 41 41 nc=True … … 44 44 nc=False 45 45 ncols=int(ncols) 46 46 nrows=int(nrows) 47 47 48 48 #check that nrows and ncols were given at the same time! 49 49 if not nr==nc: 50 50 raise StandardError('error: nrows and ncols need to be specified together, or not at all') 51 51 52 52 #Go through plots 53 53 if numberofplots: 54 54 #if plt.fignum_exists(figurenumber): … … 81 81 cbar_location=options.list[0].getfieldvalue('colorbarpos','right') # right,top 82 82 cbar_size=options.list[0].getfieldvalue('colorbarsize','5%') 83 83 cbar_pad=options.list[0].getfieldvalue('colorbarpad','2.5%') # None or % 84 84 85 85 axgrid=ImageGrid(fig, 111, 86 86 nrows_ncols=(nrows,ncols), 87 87 ngrids=plotnum, -
../trunk-jpl/src/m/plot/plot_unit.py
28 28 # }}} 29 29 # {{{ define wich colormap to use 30 30 try: 31 defaultmap=plt.cm.get_cmap('viridis' )31 defaultmap=plt.cm.get_cmap('viridis',colorlevels) 32 32 except AttributeError: 33 33 print("Viridis can't be found (probably too old Matplotlib) reverting to gnuplot colormap") 34 34 defaultmap=truncate_colormap('gnuplot2',0.1,0.9,colorlevels)
Note:
See TracBrowser
for help on using the repository browser.