stacked plot with 2 time series of different length and spacing
I have 2 time series. Both are different lengths (but they overlap for the first 1300s), and are sampled at different rates. Is there a way to plot this information on a stacked plot?
I want to be able to show the periodicity in the flucctuations so dont really want to plot them in subplot form.
files = dir(‘*.txt’);
N = length(files);
A = cell(1,N);
A2 = cell(1,N);
for ii = 1:max(size(files));
if files(ii).isdir ~=true
fname = files(ii).name;
file = fopen(fname);
A{ii} = cell2mat(textscan(file, ‘%f %f %f’));
fclose(file);
end
[~,idx] = unique(A{ii}(:,1));
A2{ii} = A{ii}(idx,:);
end
plot(A2{1}(:,2),A2{1}(:,3))
hold on
plot(A2{2}(:,2),A2{2}(:,3))
xlabel(‘Time (s)’)I have 2 time series. Both are different lengths (but they overlap for the first 1300s), and are sampled at different rates. Is there a way to plot this information on a stacked plot?
I want to be able to show the periodicity in the flucctuations so dont really want to plot them in subplot form.
files = dir(‘*.txt’);
N = length(files);
A = cell(1,N);
A2 = cell(1,N);
for ii = 1:max(size(files));
if files(ii).isdir ~=true
fname = files(ii).name;
file = fopen(fname);
A{ii} = cell2mat(textscan(file, ‘%f %f %f’));
fclose(file);
end
[~,idx] = unique(A{ii}(:,1));
A2{ii} = A{ii}(idx,:);
end
plot(A2{1}(:,2),A2{1}(:,3))
hold on
plot(A2{2}(:,2),A2{2}(:,3))
xlabel(‘Time (s)’) I have 2 time series. Both are different lengths (but they overlap for the first 1300s), and are sampled at different rates. Is there a way to plot this information on a stacked plot?
I want to be able to show the periodicity in the flucctuations so dont really want to plot them in subplot form.
files = dir(‘*.txt’);
N = length(files);
A = cell(1,N);
A2 = cell(1,N);
for ii = 1:max(size(files));
if files(ii).isdir ~=true
fname = files(ii).name;
file = fopen(fname);
A{ii} = cell2mat(textscan(file, ‘%f %f %f’));
fclose(file);
end
[~,idx] = unique(A{ii}(:,1));
A2{ii} = A{ii}(idx,:);
end
plot(A2{1}(:,2),A2{1}(:,3))
hold on
plot(A2{2}(:,2),A2{2}(:,3))
xlabel(‘Time (s)’) stacked plot, time series MATLAB Answers — New Questions