GR.jl
GR.jl copied to clipboard
odd spacing with LaTeXStrings with \textrm
example:
julia> using GR, LaTeXStrings
julia> x = rand(10)
y = rand(10)
plot(x[1:10], y, xlabel=L"\textrm{This is } \alpha")
adding tildes ~
solves the lack of spacing between words, but there is still an odd spacing between the captial T
and the text that follows:
julia> x = rand(10)
y = rand(10)
plot(x[1:10], y, xlabel=L"\textrm{This~is~}\alpha")
(jl_6ruBxL) pkg> st
Status `/tmp/jl_6ruBxL/Project.toml`
[28b8d3ca] GR v0.62.1
In the meantime, you can mix normal and math text: xlabel="This is \\alpha")
:

Is this what you want?
Thanks, quoted the alternative on the discourse thread: https://discourse.julialang.org/t/issue-with-plots-latex/71045/13
(it was not my specific problem now)
It is actually a problem I am facing. With normal math text, \alpha looks fine, though other characters look 'weird', compared to LaTeX, in particular the space between subindices:
It is actually a problem I am facing. With normal math text, \alpha looks fine, though other characters look 'weird', compared to LaTeX, in particular the space between subindices:
This may not be the exact same issue. Can you provide a MWE? I cannot reproduce that here.
That's how it looks with up-to-date versions (GR.jl
0.62.1 and GR run-time 0.62.0):
using GR
plot(randn(10),xlabel="Bilateral Trade Costs \\tau_{rlj}")
