Changeset 6497


Ignore:
Timestamp:
11/04/10 10:24:55 (14 years ago)
Author:
Mathieu Morlighem
Message:

Better error message for negative logs and do close figure if an error occurs

Location:
issm/trunk/src/m/model/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/plot/plotmodel.m

    r6088 r6497  
    4949        set(gcf,'Renderer','zbuffer');
    5050
    51         %Go through all data plottable
    52         for i=1:numberofplots,
    53 
    54                 %call unit plot
    55                 plot_manager(md,options.list{i},subplotwidth,nlines,ncols,i);
    56 
     51        %Go through all data plottable and close window if an error occurs
     52        try,
     53                for i=1:numberofplots,
     54                        plot_manager(md,options.list{i},subplotwidth,nlines,ncols,i);
     55                end
     56        catch me,
     57                figure(figurenumber),close;
     58                rethrow(me);
    5759        end
    5860else
  • issm/trunk/src/m/model/plot/processdata.m

    r5867 r6497  
    125125        %log?
    126126        if exist(options,'log'),
     127                bounds=getfieldvalue(options,'caxis',[min(data(:)) max(data(:))]);
     128                if any(data<=0) & min(bounds)<0,
     129                        error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
     130                end
    127131                pos=find(~isnan(data));
    128132                data(pos)=log(data(pos))/log(getfieldvalue(options,'log'));
     
    150154        %log?
    151155        if exist(options,'log'),
     156                bounds=getfieldvalue(options,'caxis',[min(data(:)) max(data(:))]);
     157                if any(data<=0) & min(bounds)<=0,
     158                        error('Log option cannot be applied on negative values. Use caxis option (Rignot''s settings: [1.5 max(data)])');
     159                end
    152160                data=log(data)/log(getfieldvalue(options,'log'));
    153161        end
Note: See TracChangeset for help on using the changeset viewer.