could anyone help me how to avoid the repetition of y axis values on the right with respect to the following code
1 回表示 (過去 30 日間)
古いコメントを表示
Code:
x=1:5
y1=[ 3.5743 2.4635 1.6621 1.3403 0.5476 ];
y2=[3890000 4168000 4446000 4724000 4999000 ]
y3=[ 1.5543 1.1435 0.6421 0.2303 0.1476 ];
y4=[4190000 4454000 4718000 4982000 5346000 ]
figure
[hAx,hLine1,hLine2] = plotyy(x, y1, x, y2,@(X,Y)semilogy(X,Y,'k'), @(X,Y)plot(X,Y,'k'))
hold on;
[hAx,hLine3,hLine4] = plotyy(x, y3, x, y4,@(X,Y)semilogy(X,Y,'k'), @(X,Y)plot(X,Y,'k'))
wheni run i can get the graph but y axis values on the right is occuring more than once.
Could anyone please help me how to avoid it.
0 件のコメント
採用された回答
Rui Wang Wang
2020 年 3 月 21 日
%Make the scale range of the two graphs equal , I added four "set" to set the scale , and i suggest you set different colors .
x=1:5
y1=[ 3.5743 2.4635 1.6621 1.3403 0.5476 ];
y2=[3890000 4168000 4446000 4724000 4999000 ]
y3=[ 1.5543 1.1435 0.6421 0.2303 0.1476 ];
y4=[4190000 4454000 4718000 4982000 5346000 ]
figure
[hAx1,hLine1,hLine2] = plotyy(x, y1, x, y2,@(X,Y)semilogy(X,Y,'k'), @(X,Y)semilogy(X,Y,'k'));
set(hAx1(1),'ylim',[0 5]);
set(hAx1(2),'ylim',[3890000 5346000 ]);
hold on;
[hAx2,hLine3,hLine4] = plotyy(x, y3, x, y4,@(X,Y)semilogy(X,Y,'k'), @(X,Y)semilogy(X,Y,'k'));
set(hAx2(1),'ylim',[0 5]);
set(hAx2(2),'ylim',[3890000 5346000 ]);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!