How to plot with pcolor one 2D function with two x axis ?

5 ビュー (過去 30 日間)
Ole
Ole 2016 年 2 月 7 日
コメント済み: Ole 2016 年 2 月 7 日
I would like to plot one function with two x axis. One on the bottom one on the top. The top is just different vector. How to add the second x axis on the top ?
X = rand(100,100);
x = linspace(1,100,100);
x2 = linspace(0.1,1,100);
y = linspace(100,200,100);
pcolor(x,y,X);

採用された回答

Walter Roberson
Walter Roberson 2016 年 2 月 7 日
X = rand(100,100);
x = linspace(1,100,100);
x2 = linspace(0.1,1,100);
y = linspace(100,200,100);
ax1 = axes();
pcolor(ax1, x,y,X);
ax2 = axes( 'Position', get(ax1, 'Position'), 'XAxisLocation', 'top', 'Xlim', [x2(1), x2(end)], 'YLim', get(ax1, 'YLim'), 'YTickLabel', []);
uistack(ax2, 'bottom')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by