Changeset 18660


Ignore:
Timestamp:
10/20/14 09:45:24 (10 years ago)
Author:
Mathieu Morlighem
Message:

CHG: expdisp now has options like every other functions in issm

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/exp/expdisp.m

    r18658 r18660  
    55%
    66%   Usage:
    7 %      expdisp(domainoutline,varargin)
    8 %      expdisp(domainoutline,figurenumber,linestyle,linewidth,unitmultiplier)
     7%      expdisp(domainoutline,options)
     8%
     9%   Available options:
     10%      - 'figure'     : figure number or handle
     11%      - 'linestyle'  : line style ('r--','-y',...)
     12%      - 'linewidth'  : line width (1,2,...)
     13%      - 'multiplier' : coordinate multiplier (10^3 if the plot is in km)
     14%      - 'title'      : do we add contour names to each contour
    915%
    1016%   Example:
    11 %      expdisp('Domain.exp',1,'--r',2,10^3);
     17%      expdisp('Domain.exp','figure',1,'linestyle','--r','linewidth',2,'multiplier',10^3);
    1218%
    1319%   See also EXPMASTER, EXPDOC
    1420
    15 %Get options
    16 options = pairoptions();
     21%Get and process options
     22options = pairoptions(varargin{:});
     23unitmultiplier = getfieldvalue(options,'multiplier',1);
     24linewidth      = getfieldvalue(options,'linewidth',1);
     25linestyle      = getfieldvalue(options,'linestyle','-r');
    1726
    18 %check nargin
    19 if ~nargin | nargin>5
    20         help expdisp
    21         error('expdisp error message: bad usage');
    22 end
    23 
    24 %parse input
    25 if nargin<=1,
    26         figurenumber=1;
    27 else
    28         figurenumber=varargin{1};
    29 end
    30 if nargin<=2
    31         linestyle='r-';
    32 else
    33         linestyle=varargin{2};
    34 end
    35 if nargin<=3
    36         linewidth=1;
    37 else
    38         linewidth=varargin{3};
    39 end
    40 if nargin<=4
    41         unitmultiplier=1;
    42 else
    43         unitmultiplier=varargin{4}; if isnan(unitmultiplier), unitmultiplier=1; end
    44 end
    45 
     27%read file
    4628domain=expread(domainoutline);
    4729
    48 figure(figurenumber),hold on
     30%Create figure if needed and hold
     31if exist(options,'figure'),
     32        figure(getfieldvalue(options,'figure'));
     33end
     34hold on
     35
    4936for i=1:length(domain),         
    5037        if domain(i).nods==1
  • issm/trunk-jpl/src/m/plot/applyoptions.m

    r18558 r18660  
    254254                        linewidthi=linewidth{i};
    255255                end
    256                 expdisp(filenamei,gcf,stylei,linewidthi,getfieldvalue(options,'unit',1));
     256                expdisp(filenamei,'linestyle',stylei,'linewidthi',linewidthi,'multiplier',getfieldvalue(options,'unit',1));
    257257        end
    258258end
Note: See TracChangeset for help on using the changeset viewer.