Changeset 17706


Ignore:
Timestamp:
04/09/14 21:28:35 (11 years ago)
Author:
cborstad
Message:

BUG: don't try to set default clim when data is empty, such as for a mesh plot

Location:
issm/trunk-jpl/src/m/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/applyoptions.py

    r17698 r17706  
    156156        if options.exist('clim'):
    157157                lims=options.getfieldvalue('clim')
     158                assert len(lims)==2, 'error, clim should be passed as a list of length 2'
    158159        elif options.exist('caxis'):
    159160                lims=options.getfieldvalue('caxis')
     161                assert len(lims)==2, 'error, caxis should be passed as a list of length 2'
    160162                options.addfielddefault('clim',lims)
    161163        else:
    162                 lims=[min(data.flatten()),max(data.flatten())]
    163         if len(lims)!=2:
    164                 print 'WARNING: clim/caxis should be passed as a list of length 2'
     164                if len(data)>0: lims=[data.min(),data.max()]
    165165        #}}}
    166166
  • issm/trunk-jpl/src/m/plot/plot_mesh.py

    r16097 r17706  
    1 
    21try:
    32        import pylab as p
Note: See TracChangeset for help on using the changeset viewer.