MATLAB Answers

How can I plot 3 variables on y axis for the same variable on x axis in one plot?

62 ビュー (過去 30 日間)
Sahil Patel
Sahil Patel 2020 年 4 月 29 日
コメント済み: Sahil Patel 2020 年 5 月 1 日
I used 'yyaxis' left and right for plotting two variables and then tried 'addaxis.m' fucntion to add another axis. But there seems to be an error with the 'colorord' part.
Is there another way of doing this??
Any help would be great!
Thank you.
link for the package addaxis.m i used :
  2 件のコメント
Sahil Patel
Sahil Patel 2020 年 5 月 1 日
I needed it in one plot. Anyway thank you i found the issue.

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

回答 (1 件)

Prasad Reddy
Prasad Reddy 2020 年 4 月 30 日
you can use " hold on " command.
you can write your code in the following manner.
plot(x,y1)
hold on
plot(x,y2)
hold on
plot(x,y3)
this will work
%% please give up thumb if this code works.

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by