I encountered this issue in Altair:
In R's ggplot2 you would do this to scale the fonts to size 18 - I think the default is 12.
ggplot(...) + theme_bw(base_size=18)
All the fonts are scaled relative to the base size - some are larger and some are smaller. From a usability perspective this is a really nice feature to have when making plots that are designed to be shared or published in some way.
Thanks. baseFontSize might be a good name for this, but we need to sync with latest config/theme in Vega and probably make it consistent. #1638
In Vega one would use signal to achieve this kind of effect, as the issue can concern any type of marks. In a higher level grammar this would probably be less intuitive, so what would be the typical vega-lite way?
Since vega/vega-parser#18 is closed and doesn't solve the issue,
here are the properties that I had to change to enlarge a graph :
spec.width = 800;
spec.height = 500;
spec.config.axisY.titleFontSize = 14;
spec.config.axisX.titleFontSize = 14;
spec.config.axisY.labelFontSize = 16;
spec.config.axisX.labelFontSize = 16;
spec.title.fontSize = 20;
spec.encoding.color.legend.titleFontSize = 15;
spec.encoding.color.legend.labelFontSize = 15;
(spec is the whole json object)
Maybe the issue could be reopened then?
If you want to make all fonts larger, you could also make the chart smaller and scale it up. Does that solve the original issue?
@domoritz yes it would solve it, but I only found so far the scaling option for saving charts (I'm using Altair: Figure Size/Resolution doc). I also see a scaleFactor in vega-embed, but it seems also for PNG/SVG rendering only.
For Altair, this wouldn鈥檛 work as easily but if you want to embed a chart in a presentation, you can embed the graphic and resize it.
I agree that it would be nice to have a single place to change the font size. We would need to do it in Vega, though. Could you file an issue there?
Most helpful comment
Since vega/vega-parser#18 is closed and doesn't solve the issue,
here are the properties that I had to change to enlarge a graph :
(
specis the whole json object)