KristofferC / PGFPlotsX.jl

Plots in Julia using the PGFPlots LaTeX package
Other
301 stars 40 forks source link

percentage sign in label description #237

Closed kafisatz closed 4 years ago

kafisatz commented 4 years ago

this fails for me I tried to mask the percentage sign, but was not successful

d=LogNormal(2.8,0.07);
lo, hi = quantile.(d, [0.001, 0.999])
x = range(lo, hi; length = 100)
@pgf Axis({ xlabel = "7%", ylabel = "probability density function" },
          Plot({thick, blue }, Table(x, pdf.(d, x))))
KristofferC commented 4 years ago

Did you try "7\\%"?

kafisatz commented 4 years ago

No :) Thank you this works.

I tried a few things with triple quotes (which tends to work in julia) and single backslash...

tpapp commented 4 years ago

You need either "7\\%" (which contains a single \ for escaping % in LaTeX) or raw"7\%".

kafisatz commented 4 years ago

Thanks. I have not written latex in a long time.