LaTeX in PyVista Plots #2928
Replies: 3 comments 31 replies
-
Hello, I also have the same problem. But, I know that Latex used to work in previous version of pyvista. Look at this picture |
Beta Was this translation helpful? Give feedback.
-
This requires VTK to be built with mathtext support. Are you installing from PyPI or from conda-forge? I think the wheels on PyPI are built with this by default (but I'm not 100% sure) I don't think this is enabled for the conda-forge VTK build, see conda-forge/vtk-feedstock#79 A quick way to tell if this is supported in your build of VTK is the following: >>> import vtk
>>> vtk_mathtext = vtk.vtkMathTextFreeTypeTextRenderer()
>>> vtk_mathtext.MathTextIsSupported()
True |
Beta Was this translation helpful? Give feedback.
-
Hi there. This may be strange but when I do : import pyvista as pv
p = pv.Plotter()
p.add_text(r'$\rho$')
p.show()
# not working and still displaying $\rho$ it doesn't produce the latex. But then i open another shell and I do : import vtk
import pyvista as pv
p = pv.Plotter()
p.add_text(r'$\rho$')
p.show()
#it works ! it works. (However it doesn't work if I don't open another shell). My pv.Report() is :
|
Beta Was this translation helpful? Give feedback.
-
Is there any chance to use a TeX interpreter on labels such as scalar_bar?
This would enable a uniform appearance and improve the integration into documents, right now I reduce all labels to the bare minimum and write about them in the text, anyway for greek symbols, small expression this would be very useful.
In the documentation I found only how to change the font.
Beta Was this translation helpful? Give feedback.
All reactions