Changeset 11161


Ignore:
Timestamp:
01/19/12 16:12:21 (13 years ago)
Author:
Mathieu Morlighem
Message:

Added error message if arguments are messed up, automated alreadyplot variable and fixed colorbar label definition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/model/plot/plot_scatter.m

    r10305 r11161  
    11function plot_scatter(x,y,mksize,level),
    22
    3 alreadyplot=true;
     3%check input
     4if numel(x)~=numel(y) | numel(x)~=numel(level),
     5        error('x, y and data should have the same size');
     6end
    47
    58%Some processing
     
    811Siz=length(level);
    912nlab=10;
     13
     14%OK, should we create a new colorbar for the occasion?
     15if isempty(findobj(gcf,'tag','TMW_COLORBAR')),
     16        alreadyplot=false;
     17else
     18        alreadyplot=true;
     19end
    1020
    1121%generate levels
     
    5161        warning off MATLAB:log:logOfZero;
    5262        for i = 1:nlab
    53                 if abs(min(log10(abs(tick_vals)))) <= 3, fm = '%-4.0f';   % fixed
    54                 else                                     fm = '%-4.0E';   % floating
     63                if min(log10(abs(tick_vals))) <= 3, fm = '%-4.0f';   % fixed
     64                else                                fm = '%-4.0E';   % floating
    5565                end
    5666                labels{i} = sprintf(fm,tick_vals(i));
     
    6070        % set tick label strings
    6171        set(h,'YTickLabel',labels);
    62         colorbar %one last time required sometimes
     72        %colorbar %one last time required sometimes
    6373end
Note: See TracChangeset for help on using the changeset viewer.