MatLab Multiple graphs in one axis

2 ビュー (過去 30 日間)
Gamolica
Gamolica 2023 年 5 月 26 日
コメント済み: Star Strider 2023 年 5 月 26 日
Hello,
How can i do this in matlab?
  2 件のコメント
Torsten
Torsten 2023 年 5 月 26 日
hold on
plot first graph
plot second graph
plot third graph
...
hold off
Gamolica
Gamolica 2023 年 5 月 26 日
Thank you for your answer, but I think I didn't explain myself clearly, sorry about that.
The x and y scales of the datas are very close to each other. For example;

サインインしてコメントする。

回答 (2 件)

Star Strider
Star Strider 2023 年 5 月 26 日
The easiest option is to use the hold function. Put the different ‘x’ and ‘y’ vectors in one matrix, then plot them
x = (9:0.2:10.4).'*[1 1];
y = [43.2 50 58.3 65.1 70.8 91.7 99.2 100.1; 45.8 50.4 58.3 64.1 70.8 79.2 91.7 112.5].';
figure
hold on
for k = 1:size(y,2)
plot(x(:,k), y(:,k), 's-')
end
hold off
.
  2 件のコメント
Gamolica
Gamolica 2023 年 5 月 26 日
thanks :)
Star Strider
Star Strider 2023 年 5 月 26 日
My pleasure!

サインインしてコメントする。


Torsten
Torsten 2023 年 5 月 26 日
編集済み: Torsten 2023 年 5 月 26 日
That your measurement curves overlap and those in the literature don't is a fact.
You won't be able to hide this by any special kind of plotting - unless you cheat :-)
X1 = [9 ; 9.2;9.4;9.6;9.8;10;10.2;10.4];
Y1 = [43.2 ;50; 58.3; 65.1; 70.8; 91.7; 99.2; 100.1];
X2 = X1;
Y2 = [45.8; 50.4; 58.3 ;64.1 ;70.8 ;79.2 ;91.7; 112.5];
hold on
plot(X1,Y1,'o-')
plot(X2,Y2,'o-')
hold off
grid on
  1 件のコメント
Gamolica
Gamolica 2023 年 5 月 26 日
there is no cheating :)) Thank you

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by