Ignore:
Timestamp:
05/13/14 11:58:30 (11 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 17986

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src

  • issm/trunk/src/m/plot/plotmodel.py

    r17806 r17989  
    4242                nc=True
    4343        else:
    44                 ncols=subplotwidth
     44                ncols=int(subplotwidth)
    4545                nc=False
     46        ncols=int(ncols)
     47        nrows=int(nrows)
    4648       
    4749        #check that nrows and ncols were given at the same time!
     
    5254        if numberofplots:
    5355               
    54                 if not hold: # TODO need to also check whether figurenumber is a new plot so that old plots are not mistakenly cleared
     56                if plt.fignum_exists(figurenumber):
    5557                        plt.cla()
    5658
     
    5860                if options.list[0].exist('figsize'):
    5961                        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)
    6163                else:
    6264                        fig=plt.figure(figurenumber,tight_layout=True)
    6365                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               
    6678                axgrid=ImageGrid(fig, 111,
    6779                                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.05
     80                                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
    7789                                )
     90
     91                if cbar_mode=='none':
     92                        for ax in axgrid.cbar_axes: fig._axstack.remove(ax)
    7893
    7994                for i in xrange(numberofplots):
    8095                        plot_manager(options.list[i].getfieldvalue('model',md),options.list[i],fig,axgrid[i])
    8196
    82                 plt.show()
     97                fig.show()
    8398        else:
    8499                raise StandardError('plotmodel error message: no output data found.')
Note: See TracChangeset for help on using the changeset viewer.