Robochameleon  v1.0
plotCool.m
1 function plotCool(x,y,varargin)
2 %close all
3 
4 narginchk(1,Inf);
5 
6 % check the arguments
7 if ~isnumeric(x),
8  error('Numeric argument expected') ;
9 end
10 
11 if ischar(y)
12  y=x;
13  x=1:length(x);
14 end
15 
16 % Get the color
17 col='b';
18 markf=false;
19 for i=1:length(varargin)
20  if strcmp(varargin{i}, 'color')
21  col=varargin{i+1};
22  elseif strcmp(varargin{i}, 'MarkerFace')
23  markf=true;
24  end
25 end
26 
27 resampleFactor=30;
28 xr = linspace(x(1), x(end), length(y)*resampleFactor);
29 yr = resample(y ,resampleFactor+1,1);
30 yr = yr(1:length(y)*resampleFactor);
31 
32 plot(xr, yr, varargin{:})
33 if (markf)
34  hold on
35  hh = plot(x,y, 'o', 'color', col, 'MarkerFace', col);
36  hasbehavior(hh,'legend',false)
37 end
38 
39 end
40