buruzaemon buruzaemon - 28 days ago 23
LaTeX Question

Does Gadfly support LaTeX in plot titles and labels?

I am interested in using Greek letters and math symbols in the title and labels for a Gadfly plot in Julia.

Does anyone know of a way to do this, or is this not supported (yet)?

Ben Ben
Answer

LaTeX strings (i.e. L"string") are not supported, but you can still use greek letters for labels. For example:

using Gadfly
z=linspace(0,2*pi,20)
plot(x=z, y=sin(z), Guide.YLabel("αβγ"))

These greek characters can be made in the Julia REPL or iJulia notebook by typing in the LaTeX command and pressing tab (so typing \alpha and pressing [TAB] makes α, etc.)

You can also get other math symbols this way. For example \sum [TAB] x\dot [TAB] \_j [TAB] \^2 [TAB] will get you ∑ẋⱼ²

Comments