How do I make multiple x axes?

13 ビュー (過去 30 日間)
Mike
Mike 2014 年 6 月 16 日
回答済み: José-Luis 2014 年 6 月 16 日
I am trying to create a plot with two x axes. One at the top and one at the bottom. The y axis has the same range.
I have salinity and temperature of a water column and the depth is on the y axis. I would like to make salinity and temperature different x axes.
Thanks in advance

回答 (2 件)

A Jenkins
A Jenkins 2014 年 6 月 16 日
Did you try the searching the File Exchange? There is a plotxx there you can download.

José-Luis
José-Luis 2014 年 6 月 16 日
You could try a variation of the below:
aH(1) = axes;
aH(2) = axes;
y1 = rand(10,1);
y2 = rand(10,1);
x=(1:10)';
plot(aH(1),x,y1,'Color',rand(1,3));
plot(aH(2),x,y2,'Color',rand(1,3));
linkaxes(aH,'x')
set(aH(2),'Color','none','XAxisLocation','top','YAxisLocation','right');

カテゴリ

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