Closed zhiyuanzhai closed 3 years ago
Looks like a bug in the Plots.jl wrapper. It seems they do some escaping, the legend entry that gets created is
julia> p = plot(1:20, label="\$y_1\$")
julia> p.o.the_plot.elements[1].elements[1].contents[end]
PGFPlotsX.LegendEntry(PGFPlotsX.Options(OrderedCollections.OrderedDict{Any, Any}(), false), "\$y\\_1\$", false)
It seems you can use LaTeXStrings
to fix it:
julia> using LaTeXStrings
julia> p = plot(1:20, label=L"$y_1$")
If you want to follow up on this, please report it to the Plots.jl repo.
It doesn't seem to work for me. I'm considering to report it to Plots.jl
. Anyway, thanks!
For example:![example](https://user-images.githubusercontent.com/37478391/115812774-86aa0780-a424-11eb-9382-43989aafbbdc.png)
The lower index in the axes shows as normal, but the ones in the legend are shown some kind of raw code instead of lower indices.