Changeset 17989 for issm/trunk/src/m/plot/plotmodel.py
- Timestamp:
- 05/13/14 11:58:30 (11 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 17807-17808,17810-17985
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/plot/plotmodel.py
r17806 r17989 42 42 nc=True 43 43 else: 44 ncols= subplotwidth44 ncols=int(subplotwidth) 45 45 nc=False 46 ncols=int(ncols) 47 nrows=int(nrows) 46 48 47 49 #check that nrows and ncols were given at the same time! … … 52 54 if numberofplots: 53 55 54 if not hold: # TODO need to also check whether figurenumber is a new plot so that old plots are not mistakenly cleared56 if plt.fignum_exists(figurenumber): 55 57 plt.cla() 56 58 … … 58 60 if options.list[0].exist('figsize'): 59 61 figsize=options.list[0].getfieldvalue('figsize') 60 fig=plt.figure(figurenumber,figsize= figsize,tight_layout=True)62 fig=plt.figure(figurenumber,figsize=(figsize[0],figsize[1]),tight_layout=True) 61 63 else: 62 64 fig=plt.figure(figurenumber,tight_layout=True) 63 65 fig.clf() 64 65 # options to pass: axes_pad, share_all, label_mode ("1","L","all"), cbar_mode (none,single,each), cbar_location(right,top) 66 67 # options needed to define plot grid 68 direction=options.list[0].getfieldvalue('direction','row') # row,column 69 axes_pad=options.list[0].getfieldvalue('axes_pad',0.25) 70 add_all=options.list[0].getfieldvalue('add_all',True) # True,False 71 share_all=options.list[0].getfieldvalue('share_all',True) # True,False 72 label_mode=options.list[0].getfieldvalue('label_mode','1') # 1,L,all 73 cbar_mode=options.list[0].getfieldvalue('cbar_mode','each') # none,single,each 74 cbar_location=options.list[0].getfieldvalue('cbar_location','right') # right,top 75 cbar_size=options.list[0].getfieldvalue('cbar_size','5%') 76 cbar_pad=options.list[0].getfieldvalue('cbar_pad','2.5%') # None or % 77 66 78 axgrid=ImageGrid(fig, 111, 67 79 nrows_ncols=(nrows,ncols), 68 direction= 'row',69 axes_pad= 0.05,70 add_all= True,71 share_all= True,72 label_mode= 'all',73 cbar_mode= 'single',74 cbar_location= 'right',75 cbar_size= '5%',76 cbar_pad= 0.0580 direction=direction, 81 axes_pad=axes_pad, 82 add_all=add_all, 83 share_all=share_all, 84 label_mode=label_mode, 85 cbar_mode=cbar_mode, 86 cbar_location=cbar_location, 87 cbar_size=cbar_size, 88 cbar_pad=cbar_pad 77 89 ) 90 91 if cbar_mode=='none': 92 for ax in axgrid.cbar_axes: fig._axstack.remove(ax) 78 93 79 94 for i in xrange(numberofplots): 80 95 plot_manager(options.list[i].getfieldvalue('model',md),options.list[i],fig,axgrid[i]) 81 96 82 plt.show()97 fig.show() 83 98 else: 84 99 raise StandardError('plotmodel error message: no output data found.')
Note:
See TracChangeset
for help on using the changeset viewer.