MATLAB Answers

Signal visualization using subplot, y axis scroll bar and autoscale

3 views (last 30 days)
ALDO
ALDO on 21 Jun 2020
Edited: ALDO on 26 Jun 2020
Hi everyone
I need help plotting the data I have below in a user-friendly figure so that it is possible to scroll and view such a large-scale data easily.
I have 4 different biological signals A, B, C and D. I would like to plot them in one figure with 4 subplots that has a y-axis scroll bar and auto adjusts x axis limits so as you scroll you only can view ranges that have data. The figure should show a 15-minute window per scroll.
The y axis has the same unit time for all (seconds). A and C have sampling frequency of 1sample/sec. B and D have sampling frequency of 125 samples/sec.
You can find the code I have for this bellow. I just cannot seem to get it to work properly. I would appreciate any help on this.
Thanks in advance!
variable sizes:
A,C=83550x1 double, data range= min 50, max 110
B,D=7231045x1 double , data range= min 1000, max 3000
subplot(4,1,1);
T0=1:(length(A)); % this is in secods
plot(T0,A)
xlim([0,900])
%ylim([-inf,inf])
axis 'auto y'
xlabel('time(s)')
ylabel('A')
subplot(4,1,2);
T=1:(length(B)); % I would like it to be in seconds
T1=T./125; % Im trying to adjust for the sampling frequency
plot(T1,B)
xlim([0 900]);
ylim([900 3100]);
xlabel('time(s)')
ylabel('B')
subplot(4,1,3);
T0=1:(length(C));
plot(T0,C)
xlim([0,900])
%axis 'auto y'
ylim([-inf,inf])
xlabel('time(s)')
ylabel('C')
subplot(4,1,4);
T=1:(length(D));
T1=T./125;
plot(T1,D)
xlim([0 900]);
ylim([900 3100]);
xlabel('time(s)')
ylabel('D')
samexaxis('abc','xmt','on','ytac','join','yld',1); % This will allow you to have the same y axis. You also need parseArgs.m before running it
%I have tried using : scrollplot('axis','xy', 'minx',0, 'miny',900) and 'scrollplotdemo' but was not succesfull

  0 Comments

Sign in to comment.

Answers (0)


Translated by