Plots.jl: Recipes cannot set default fonts

Created on 29 Oct 2016  路  6Comments  路  Source: JuliaPlots/Plots.jl

In order to set default fonts, one needs to do something like:

  xtickfont --> font(11)
  ytickfont --> font(11)
  legendfont --> font(11)
  guidefont  --> font(11)

However, font is in Plots and not RecipesBase, so changing the default font requires a Plots dependency.

Most helpful comment

I think that's the right way to go since font doesn't really fit in with the way the other attributes work.

All 6 comments

I've had this thought from other perspectives. Really the "correct" solution is to have a bunch of attributes: guidefontsize, guidefontfamily, etc... and then guidefont would be a way to set all of those at once, similar to marker or line. The downside is that it's a lot of new attributes to maintain/access, and the upside is that this issue wouldn't exist. :)

I think that's the right way to go since font doesn't really fit in with the way the other attributes work.

A few additional coments:

  1. There should be a way to scale all fonts simultaneously. Possibly adding the following to the ~/.juliarc.jl file:
PLOTS_DEFAULTS = Dict(:fontadjust => 1.5)
  1. It would be nice if this attribute was also available "@ runtime":
plt = plot(...)
display(plt) #Want smaller font to maximize real-estate

plot!(size=(1000,800), fontadjust=2.2) #Make more readable on print.
png("morereadbleplot.png")

This is a recurring issue and a very nice feature to have. Thank you for reporting it @ChrisRackauckas.

All that's needed is for someone to implement this change in practice:

  • [ ] unexport the Font type (it can still be used internally)
  • [ ] add the new keywords
  • [ ] updating the handling of keywords to form the Font object
  • [ ] specify a new 'font' magic keyword

This is great to see! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crstnbr picture crstnbr  路  3Comments

pkofod picture pkofod  路  3Comments

kleinschmidt picture kleinschmidt  路  3Comments

PallHaraldsson picture PallHaraldsson  路  4Comments

nebuta picture nebuta  路  3Comments