Making plot with two x-axis and two y-axis

87 ビュー (過去 30 日間)
simen ommundsen
simen ommundsen 2019 年 4 月 30 日
コメント済み: Akshay Dhyani 2021 年 5 月 27 日
Hello everyone!
I am trying to plot two different vectors with different lengths. Therefor i most likely need two x-axis but i also need two y-axis
this is what im trying to plot:
yyaxis left
plot(datenum(Time),Pmax);
yyaxis right
plot(datenum(Time2),Midtemp);
xticks=get(gca,'xtick');
set(gca,'xticklabel',cellstr(datestr(xticks))')
The problem is that Time and Pmax is same length and Time2 and Midtemp is the same length.
Therefor i need two x-axis and two y-axis.

採用された回答

Raj
Raj 2019 年 4 月 30 日
I think this will help.
  2 件のコメント
simen ommundsen
simen ommundsen 2019 年 4 月 30 日
Yes that worked!
Thanks!
Akshay Dhyani
Akshay Dhyani 2021 年 5 月 27 日
Can someone explain yyaxis right/left works but xxaxis top/bottom doesn't work?
What are the alternatives to put x axis top and bottom with Y axis left and right so I can superimpose two dataset on each other and check the difference?

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

その他の回答 (0 件)

カテゴリ

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