Open charles92 opened 8 years ago
Yes, coming from Matlab and sick of its headaches, this would be very useful. Matplotlib supports it, though I'm glad the devs worked to get MayaVi going on Python 3.5 at all. Matplotlib's 3D graphing is not quite good enough for most applications.
I wrote a package to enable latex support for mayavi called mlabtex: https://github.com/MuellerSeb/mlabtex
It produces an image rendered with matplotlib and uses this as a texture for a mlab.surf. The interface is similar to mlab.text3d.
With this, you can do something like that:
import os
os.environ['QT_API'] = 'pyqt'
os.environ['ETS_TOOLKIT'] = 'qt4'
from mayavi import mlab
from mlabtex import mlabtex
TEXT = (r'Sebastian M\"uller, ' +
r'$f(x)=\displaystyle\sum_{n=0}^\infty ' +
r'f^{(n)}(x_0)\cdot\frac{(x-x_0)^n}{n!}$')
tex = mlabtex(0., 0., 0.,
TEXT,
color=(0., 0., 0.),
orientation=(30., 0., 0.),
dpi=1200)
mlab.axes()
mlab.show()
You can install it now with:
pip install mlabtex
That is very cool! Thank you for sharing!
thanks! I'm looking for a way to use LaTeX in the axis labels, though.
It would be very convenient to have TeX or LaTeX symbols for plots of scientific datasets, as is in Matplotlib.