I am trying to create a figure with one set of time-series using
ylimit = [-100,100];
and another few time-series with the automatically-chosen y-limits, which are different by several orders of magnitude. Each plot shares the same x-axis limits. I want to really zoom in on the dynamics in the first set of time-series. That is the reason for the static y-limits. However, when I add the time-series which have much larger y-limits, the first set of time-series appears to zoom out and the dynamics are very difficult to see.
hf=figure; clfchans = 16;t = tiledlayout(chans,1,'TileSpacing','Compact','padding','compact'); %setup tile for all subplots
cmap = colormap; %get current colormap
allColors = cmap(chans:chans:chans*chans,:); %split colormap into diff colors per chan
ylimit = [-100,100]; %set y-limit for zoomed-in view of dynamics
for subplotN=1:chans-3 %plot first set of time-series
nexttile x = 1:2841; y = randn(1,2841)*50; plot(x,y,'LineWidth',2,'Color',allColors(subplotN,:)) ylim(ylimit)end
This code yields the following figure. Looks decent, I can see the dynamics:
Now, I add the next time-series with a ylimit that is several orders of magnitude different
nexttiley1 = randn(1,2841)*1e6;plot(x,y1,'LineWidth',2,'Color','b');
This causes the previous traces to zoom out so it's way harder to see their dynamics:
How can I fix this? I want the previous time-series to stay zoomed-in as I add the remaining tiles with significantly larger ylimits.
Thank you in advance for any help.
Best Answer