Multiple Lines in a Stacked Plot
조회 수: 16 (최근 30일)
이전 댓글 표시
I'd like to have 3 different vectors plotted onto 2 graphs within a stacked plot. For example, I wish to plot vectors a and b in the first graph of the stacked plot and variable c on the second graph, with the x-axis of the stacked plot being another vector, t. How would I be able to do that?
댓글 수: 0
채택된 답변
Dyuman Joshi
2023년 11월 21일
이동: Dyuman Joshi
2023년 11월 21일
If you are working with R2018b or a later version, check out stackedplot
%Random data
n = 10;
t = (1:n).';
a = zeros(n,1);
b = ones(n,1);
c = rand(n,1);
data = table(t, a, b, c)
vars = {["a" "b"], "c"};
stackedplot(data, vars, "XVariable", "t")
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!