How to make the negative sign of y axis to be up ?

回答 (2 件)

dpb
dpb 2024 年 7 月 15 日
編集済み: dpb 2024 年 7 月 15 日

0 投票

plot([-1000:100:100]);
hAx=gca;
hAx.YDir='reverse';
See axes documentation for all the details...
VBBV
VBBV 2024 年 7 月 15 日

0 投票

ydata = -900:100:100
ydata = 1x11
-900 -800 -700 -600 -500 -400 -300 -200 -100 0 100
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
xdata = ydata.*ones(1,length(ydata))
xdata = 1x11
-900 -800 -700 -600 -500 -400 -300 -200 -100 0 100
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
plot(xdata,ydata)
yticks = ydata;
yticklabels(fliplr(yticks))

1 件のコメント

dpb
dpb 2024 年 7 月 15 日
ydata = -900:100:100;
xdata = ydata;
plot(xdata,ydata)
hAx=gca;
hAx.YDir='reverse';
The above reverses the actual relation between the x, y values; as defined, y==x so the negative x and y values should be associated visually.

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

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

タグ

質問済み:

2024 年 7 月 15 日

編集済み:

dpb
2024 年 7 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by