问题描述
我在GR后端使用Plots.jl在JuliaLang中生成一些图。我注意到,当使用LaTeXStrings.jl在图例标签中生成Latex字符串时,这些标签会靠在一起。为了说明我的意思,我编辑了JuliaPlots linestyle example以在图例标签中使用Latex字符串。代码如下:
using Plots; gr()
using LaTeXStrings
styles = filter((s->begin
s in Plots.supported_styles()
end),[:solid,:dash,:dot,:dashdot,:dashdotdot])
styles = reshape(styles,1,length(styles))
n = length(styles)
y = cumsum(randn(20,n),dims = 1)
plot(y,line = (5,styles),label = [L"s^{ol}_{id}" L"d^{as}_h" L"d^{o}_{t}" L"d^{ash}_{dot}" L"dash^{dot}_{dot}"],legendtitle = "linestyle")
上面的代码产生以下图:
如您所见,一个标签的下标与紧邻其正下方的标签的上标非常接近。对于图例标题也是如此。
我想增加每个标签之间的间距/填充,以使每个标签的上标和下标之间没有间隙,但是不知道该怎么做。