matplotlib set_label_position 在 3d 中没有效果? [英] matplotlib set_label_position no effect in 3d?
问题描述
我正在尝试在 matplotlib 的 3d 视图中移动轴标签的位置.我试过 ax.xaxis.set_label_position
和 ax.xaxis.set_label_coords
.两者似乎都没有作用.
I am trying to move the position of the label of the axis in 3d view in matplotlib. I have tried ax.xaxis.set_label_position
and ax.xaxis.set_label_coords
. Both seem to have no effect.
我想将 t/T_L 移离标签刻度.怎么做的?
I'd like to move t/T_L away from the label ticks. How is it done?
推荐答案
3D 图中的标签填充与 2D 图中的填充方式不同.
Label padding in 3D plots does not work the same way as for 2D plots.
如这个答案所示,您可以设置labelpadcode> 使用
ax.xaxis._axinfo['label']['space_factor']
.它不是特别漂亮,但很管用.
As shown in this answer, you can set the labelpad
using ax.xaxis._axinfo['label']['space_factor']
. Its not particularly pretty, but it works.
ax.xaxis._axinfo['label']['space_factor'] = 2.8
这篇关于matplotlib set_label_position 在 3d 中没有效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!