How to use LaTeX Computer Modern font for all text in all plots?

How can I set up Plots.jl to use Computer modern for all labels in all plots (on macos)?

With the config

using LaTeXStrings
using Plots
gr()
DPI = 150
default(
    size=(70 * sqrt(2) * DPI / 25.4, 70 * DPI / 25.4),
    fontfamily="Computer Modern",
    titlefont=font(12),
    legend=:topright,
    legendfont=font(10),
    tickfont=font(10),
    linewidth=2, markersize=4,
    xlabelfont=font(10),
    ylabelfont=font(10),
)
display(plot(title="test"))

the title and the ticks are in sans-serif instead of serif CM.

1 Like