I am trying to plot a series of related data together (sharing the same x-axis). Most sets of the data cover a very similar y range (0-1), but one of the data sets cover a comparably larger range (0-2). I desire each plot to be on its own y-axis, but with a shared x-axis, but I'd like the size of each subplot to match the total y-range that the respective data covers. So my script looks something like:
data1_raw = rand(11,1);
data1_fit = repmat(mean(data1_raw),11,1);
data2_raw = 2*rand(11,1);
data2_fit = repmat(mean(data2_raw),11,1);
t = table(data1_raw,data1_fit,data2_raw,data2_fit);
s = stackedplot(t,{{'data1_raw','data1_fit'},{'data2_raw','data2_fit'}});s.AxesProperties.plot_start = [0 0.33]
What I get from this is the below plot:
What I want is this plot:
2 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/545204-how-do-i-change-the-size-of-subplots-in-stackedplot#comment_890915
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/545204-how-do-i-change-the-size-of-subplots-in-stackedplot#comment_890915
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/545204-how-do-i-change-the-size-of-subplots-in-stackedplot#comment_898551
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/545204-how-do-i-change-the-size-of-subplots-in-stackedplot#comment_898551
Sign in to comment.