Put axis label in their respective middle (3D plot)
97 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Francesco Porretta
il 30 Set 2021
Commentato: Kelvin Anoh
il 11 Mag 2024
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/754794/image.jpeg)
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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/754799/image.jpeg)
Is it possible??
0 Commenti
Risposta accettata
dpb
il 30 Set 2021
Modificato: dpb
il 30 Set 2021
...
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 Commento
Kelvin Anoh
il 11 Mag 2024
hXL.Rotation = 15; % where 15 is the angle of rotation in degrees
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Axis Labels in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!