Customized stairs-step plot with various linetype and color display options. (see function stairs.m) Input: - x: vector [1,m] - y: vector (optional) [1,m] - tt: string for color display and linetype (optional) [1,p] - mode: 1 -> centering the step around x, 0 -> the step starts at x[1,1] (default = 1) Output: - x0: vector [1,m] - y0: vector [1,m] by Y.PEYSSON CEA-DRFC <yves.peysson@cea.fr>
0001 function [x0,y0] = stairs_dke_yp(x,y,xlabelmode,ylabelmode,titlemode,xlimmode,ylimmode,colormode,linemode,widthmode,mode) 0002 % 0003 % Customized stairs-step plot with various linetype and color display options. 0004 % (see function stairs.m) 0005 % 0006 % Input: 0007 % 0008 % - x: vector [1,m] 0009 % - y: vector (optional) [1,m] 0010 % - tt: string for color display and linetype (optional) [1,p] 0011 % - mode: 1 -> centering the step around x, 0 -> the step starts at x[1,1] 0012 % (default = 1) 0013 % 0014 % Output: 0015 % 0016 % - x0: vector [1,m] 0017 % - y0: vector [1,m] 0018 % 0019 % 0020 %by Y.PEYSSON CEA-DRFC <yves.peysson@cea.fr> 0021 % 0022 n = length(x); 0023 delta = (max(x) - min(x)) / (n-1); 0024 nn = 2*n; 0025 yy = zeros(nn+2,1); 0026 xx = yy; 0027 t = x(:)' - mode*0.5*delta; 0028 xx(1:2:nn) = t; 0029 xx(2:2:nn) = t; 0030 xx(nn+1:nn+2) = t(n) + [delta;delta]; 0031 yy(2:2:nn) = y; 0032 yy(3:2:nn+1) = y; 0033 if nargout == 0 0034 [ax] = graph1D_jd(xx,yy,0,1,xlabelmode,ylabelmode,titlemode,NaN,xlimmode,ylimmode,linemode,'none',colormode,widthmode); 0035 else 0036 xo = xx; 0037 yo = yy; 0038 end