MCPcopy
hub / github.com/matplotlib/matplotlib / test_axes3d_labelpad

Function test_axes3d_labelpad

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:1139–1157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1137
1138@mpl3d_image_comparison(['axes3d_labelpad.png'], remove_text=False, style='mpl20')
1139def test_axes3d_labelpad():
1140 fig = plt.figure()
1141 ax = fig.add_axes(Axes3D(fig))
1142 # labelpad respects rcParams
1143 assert ax.xaxis.labelpad == mpl.rcParams['axes.labelpad']
1144 # labelpad can be set in set_label
1145 ax.set_xlabel('X LABEL', labelpad=10)
1146 assert ax.xaxis.labelpad == 10
1147 ax.set_ylabel('Y LABEL')
1148 ax.set_zlabel('Z LABEL', labelpad=20)
1149 assert ax.zaxis.labelpad == 20
1150 assert ax.get_zlabel() == 'Z LABEL'
1151 # or manually
1152 ax.yaxis.labelpad = 20
1153 ax.zaxis.labelpad = -40
1154
1155 # Tick labels also respect tick.pad (also from rcParams)
1156 for i, tick in enumerate(ax.yaxis.get_major_ticks()):
1157 tick.set_pad(tick.get_pad() + 5 - i * 5)
1158
1159
1160@mpl3d_image_comparison(['axes3d_cla.png'], remove_text=False, style='mpl20')

Callers

nothing calls this directly

Calls 10

Axes3DClass · 0.90
figureMethod · 0.80
add_axesMethod · 0.80
set_xlabelMethod · 0.80
set_ylabelMethod · 0.80
set_zlabelMethod · 0.80
get_zlabelMethod · 0.80
get_major_ticksMethod · 0.45
set_padMethod · 0.45
get_padMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…