0001 function [xdata,ydata] = get_lines
0002
0003
0004
0005
0006
0007 sibs = get(gca,'Children');
0008
0009
0010
0011
0012
0013 lines = 0;
0014 xdata = [];
0015 ydata = [];
0016
0017 i = max(size(sibs));
0018 while i >= 1,
0019 if strcmp(get(sibs(i),'Type'),'line')
0020
0021 getline = 1;
0022 if ~isempty(xdata),
0023 if isequal(size(get(sibs(i),'XData').',1),size(xdata,1)),
0024 getline = 1;
0025 else
0026 getline = 0;
0027 end
0028 end
0029 if getline,
0030
0031 lines = lines + 1;
0032 datalines(lines) = sibs(i);
0033
0034
0035 xdata(:,lines) = get(sibs(i),'XData').';
0036 ydata(:,lines) = get(sibs(i),'YData').';
0037 end
0038 end
0039 i = i - 1;
0040 end