フィルターのクリア

How to plot 3 parameters on same axis having different values

4 ビュー (過去 30 日間)
Safi ullah
Safi ullah 2017 年 3 月 21 日
回答済み: ANKUR KUMAR 2018 年 1 月 9 日
Hi, I need to plot 4 parameters A,B,C and Y in one Fig for comparison A,B,C on x-axis and Y on y-axis.one parameter has small values 10^-29 due to which this parameters only appear at zero as a single line not looking proper to give some result. I tried plotyy and plot hold on.A,B,C and Y are matrices of 10*1.
  1 件のコメント
Pawel Jastrzebski
Pawel Jastrzebski 2018 年 1 月 8 日
You should try plotting the values using the logarithmic or semi logarithmic scale.

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

回答 (1 件)

ANKUR KUMAR
ANKUR KUMAR 2018 年 1 月 9 日
You can use plotyy function
yyaxis left
plot(x,blt,'r','linewidth',1.5)
yyaxis right
plot(x,tchp,'b','linewidth',1.5)
legend('blt','tchp')
yyaxis left
xlabel('Radial Distance')
ylabel('BLT')
yyaxis right
ylabel('TCHP')
There is one disadvantage of this above function. You can not add more than 2 axis. TO add lots of X axis on your plot, use this function from file exchange https://in.mathworks.com/matlabcentral/fileexchange/9016-addaxis
plot(x,blt,'r','linewidth',1.5);
addaxis(x,tchp,'b','linewidth',1.5);
addaxis(x,mld,'k','linewidth',1.5);
addaxislabel(1,'BLT');
addaxislabel(2,'TCHP');
addaxislabel(3,'MLD');
legend('BLT','TCHP','MLD');

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by