フィルターのクリア

Put axis label in their respective middle (3D plot)

97 ビュー (過去 30 日間)
Francesco Porretta
Francesco Porretta 2021 年 9 月 30 日
コメント済み: Kelvin Anoh 2024 年 5 月 11 日
I'm trying to put the axis label in a 3D plot in the middle of the axis, without rotate them.
As example, consider this figure
obtained using this code:
colormap(hsv);
s = 0:0.025:3;
t = s;
[x,y] = meshgrid(s,t);
z = x.^2 - y.^2;
mesh(x,y,z);
xlabel('time[sec]')
ylabel('position[mm]')
zlabel('force[N]')
What I want to obtained is something as shown in figure below (look x and y labels).
Is it possible??

採用された回答

dpb
dpb 2021 年 9 月 30 日
編集済み: dpb 2021 年 9 月 30 日
...
mesh(x,y,z);
hXL=xlabel('time[sec]'); % default label, save handle
hXL.Position=hXL.Position+[0.5 0 0]; % adjust default position
comes reasonably close -- salt to suit and follow the same idea for y.
  1 件のコメント
Kelvin Anoh
Kelvin Anoh 2024 年 5 月 11 日
You may also wish to rotate the text following @dpb's example:
hXL.Rotation = 15; % where 15 is the angle of rotation in degrees

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by