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

97 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by