Supported (Latex like) fontfamilies Plots.jl GR.jl

Hi all,
I’m trying to figure out which fontfamilies can be used with Plots.jl using GR.jl. Is it system dependent? I am looking specifically for a “Computer Modern” like family. I couldn’t find a list or explanation what could be used and would really appreciate your help to figure that out.

Minimal working example would be:

using Plots
plot(collect(1:10),fontfamily="Times")

http://gr-framework.org/fonts.html?highlight=font

1 Like

I typically use Latin Modern Math in Makie. In Makie at least you can use every font installed on your computer.

Computer modern font is supported by GR but I don’t know how to set it in Plots.

plot(collect(1:10),fontfamily="Computer Modern")

is not working.

Any idea?

1 Like

I went through the Plots/gr.jl code and I found that computer modern font is there but you need to set the font family to

plot!(fontfamily="serif-roman") 
2 Likes

Soon we will also support

plot(collect(1:10),fontfamily="Computer Modern")

(https://github.com/JuliaPlots/Plots.jl/pull/3096)

4 Likes

I compared the axis fonts in figure plotted by gr() backend and pgfplots() backend and I think that the gr() has smaller spaces between characters. Please compare in figure.

From my perspective, the original latex spacing is better to read. Is there way how to set it?

cc: @jheinen

We will check this, but, unfortunately, we can’t offer a short-term solution.

3 Likes