If I make a 3d plot in Matplotlib:
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.gca(projection=\'3d\')
x_labels = [10,20,30]
x = [1,2,3,4
It's probably too late, but I came across similar problems and here is what I did to remove the white space: use fig.subplot_adjust()
to put left/right outside the normal region. In your case I found fig.subplot_adjust(left=-0.11)
gives a reasonable result.
Full code below:
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.gca(projection='3d')
x_labels = [10,20,30]
x = [1,2,3,4]
y = [3,1,5,1]
legend = False
for label in x_labels:
x_3d = label*np.ones_like(x)
ax.plot(x_3d, x, y, color='black', label='GMM')
if legend == False:
ax.legend()
legend = True
ax.set_zlabel('test')
fig.tight_layout()
fig.subplots_adjust(left=-0.11) # plot outside the normal area