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)?
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)?
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 ∑ẋⱼ²
Sadly, it looks like LaTeX support for plot labels and such in Gadfly does not exist.
However, HTML tags such as <sup> and <sub> let you do a bit of text formatting, and you can also use HTML 4.0 character entity, decimal character and hexadecimal character references.