Choice of font does not get saved in the figure

I have the following code:

using Plots
plotlyjs()

p1=plot(x, y, fill = (0, 0.5, :black), label="",lw=3, lc = :black,
    ylims=(0,730000),
    title = "Construction of new houses, 1991-2014",
    xtickfont = font(10, "TimesNewRoman"),
    ytickfont = font(10, "TimesNewRoman"),
    titlefont = font(14, "TimesNewRoman"))
savefig(p1,"HousingStarts.png")

My problem is, that the my choice of the font does not get saved when, i.e. it is back to some sans-serif font instead of Times New Roman. Is that a bug and is there a workaround?

EDIT: Another “bug” I found it that if I press “save as png” in the Atom/Juno plot plane, I save the figure with the right font, but if I specified a different size, it does not get saved as well, for example:


final=plot(p1,p2,layout=(1,2),size= (900,300),
        xtickfont = font(10, "TimesNewRoman"),
        ytickfont = font(10, "TimesNewRoman"),
        titlefont = font(14, "TimesNewRoman"))

This should be opened as an issue on the Plots.jl Github repository:

@mkborregaard

1 Like

Thanks, I’ll do.