フィルターのクリア

axis labels in 3D mesh

155 ビュー (過去 30 日間)
friet
friet 2017 年 7 月 14 日
回答済み: Star Strider 2017 年 7 月 15 日
Hello, I have a question about axis label position. In my figure below, the position of the labels is a little bit not well aligned with the axis angle. How can I make the labels of my axis at the center of my axis and also to rotate the angle of the text so that it is in line with the axis.
Thanks
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]')

回答 (1 件)

Star Strider
Star Strider 2017 年 7 月 15 日
This has been a problem as long as I can remember. There is a File Exchange contribution, Tools for Axis Label Alignment in 3D Plot (link) that apparently does this automatically.
Another option is just to experiment with the 'Rotation' property until it works. Note that if you rotate the axes, you have to re-code the 'Rotation' angle values.
Example
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]', 'Rotation',20)
ylabel('position[mm]', 'Rotation',-30)
zlabel('force[N]')

カテゴリ

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