I’d like to label a line on a plot using LaTeX to write a norm, e.g.
but the text inside the norm appears shifted to the right and the spacing between the double bars is greater than expected. I was hoping the label text would look more like
Is there a way to get my desired appearance?
(Julia official release 1.6.1 (2021-04-23) on OS X)
I think this is a bug in GR’s fonts rendering
Yeah, there’s a couple of those. It also messes up
GR doesn’t actually run
LaTeX, but has its own built-in approximation. Doesn’t always work.
Workaround: use unicode:
It works fine with Plots.jl’s
using LaTeXStrings, Plots; pgfplotsx()
That does look nicer - thanks! At the end of the day this will allow me to generate my plots, but it’s a bit inconvenient because my other plots unfortunately don’t work with
pgfplotsx() (and they’re slow, so I want to use GR for its promised speed). Simply changing the backend for some of the plots doesn’t work in my code as written, because of this issue where you can’t change plot backends within a function. In any case, I’ll mark this as the solution since the original problem is a known issue with the GR backend.
You should be able to hack it with