How can a overlapping of labels and ticks be avoided when using matplotlib 3d plots?
The code below produces a matplotlib- figure. This figure shows a problem with labelpadding and 3D plots when using LaTeX in the labels. (Maybe someone with enough rights can post a corresponding figure)
There is a solution if one does not uses LaTeX in the label: Adjust label positioning in Axes3D of matplotlib
If you use LaTeX for rendering the label then a \n at the beginning is ignored (or produces errors)! I have tried a lot from \phantom and \vspace*, from \mbox to minipage, but it does not work! Is there any solution for mplot3d + x,y,zlabel + LaTeX
In the mplot3d API docu (http://matplotlib.org/mpl_toolkits/mplot3d/api.html) is mentioned, that the parameter labelpad is not jet implemented 'Currently, labelpad does not have an effect on the labels.'.
Example:
import matplotlib.pyplot as pyplot
import mpl_toolkits.mplot3d
from matplotlib.pyplot import rc
rc('text', usetex = True)
rc('font', size=9, family='serif', serif='Times')
fig = pyplot.figure(figsize=(8/2.5, 5/2.5))
ax = fig.gca(projection='3d')
plot = ax.plot([.1,.2,.3],[.1,.2,.3])
xLabel = ax.set_xlabel('XxxXxxX')
yLabel = ax.set_ylabel('YyyYyyY')
zLabel = ax.set_zlabel('ZzzZzzZ') # \n in here produces an error or is ignored see below
pyplot.show()
...
Things I have tried:
ax.set_ylabel(r"\phantom{x}" "\n" r'ABC', linespacing=-0.5)