LaTeX code for titles, labels,... with Plots.jl

Which backend are you using for Plots?
If you haven’t selected it then you’re using the default one (GR). In my experience, the solution given in the answer above your post should work, then… something like "\$\\mathrm{Unit is} 10^3\$"

Maybe you could try PGFPlots?

using Plots; pgfplots()
using LaTeXStrings

An example:
plot(..., ..., label=L"...", yaxis=:log, lw=1, color=1, line=:dot, xlabel=L"k", ylabel=L"\|r_k\|", legend=:best)

Hello Guys,

I am in Juno and under Linux. I could not get aplha on my PyPlot graphs, and the following worked for me after some trial runs, e.g.:

using Plots, LaTeXStrings
plot!(xdata, ydata, label = "\\alpha")

Hope this will help somebody…

2 Likes

Btw, i realized that if you want to combine greek and other characters with a text, it gets a bit trickier…
I could solve it through this hack (funny part, no using LaTeXStrings is needed), e.g.:

ylabel!("Permeability in z-direction"*"\\mu"*"m")

Works for titles, data and axes labels.

4 Likes