Thanks to visit codestin.com
Credit goes to github.com

Skip to content

axes3d label padding does not work #3610

Closed
@hughesadam87

Description

@hughesadam87

This seems to go back pretty long:

http://stackoverflow.com/questions/5525782/adjust-label-positioning-in-axes3d-of-matplotlib/15603305#15603305

Adjusting the label position of a 3d axes using ax.y_axis.labelpad = 5 for example does not work.

Here's an example:

import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt

mpl.rcParams['legend.fontsize'] = 10

fig = plt.figure()
ax = fig.gca(projection='3d')
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
ax.plot(x, y, z, label='parametric curve')
ax.legend()

ax.set_xlabel('TEST LABEL')
ax.xaxis.labelpadding = 5

plt.show()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions