Gadfly Title Size

I want to have a different font size for a Gadfly Guide.title() versus Guide.xlabel(). Setting major_label_font_size affects both. How do I control the title size separately?

Maybe, you can send in a PR to extend Compose.jl/fontfallback.jl at da671cd35805bfbd9dc7a433830b4a8d608fe93a · GiovineItalia/Compose.jl · GitHub to include <h1>, <h2>, <h3> where these tags set font-size to something like 200%, 150% and 120%. Note that I’m not a maintainer, so it might be that the maintainers don’t agree with this plan.

For example, currently Guide.title("T<sub>i</sub><sup>2</sup>") gives


It looks like your HTML tags resulted in the superscript being attached to the subscript. Is that what those tags should produce?

Gadfly has a helper function title. It was developed for stacked plots (?title), but works on any rendered plot:

using Compose, Gadfly
p = plot(x=1:5, y=rand(5), Geom.point)
p1 = title(render(p), "My awesome plot", Compose.fontsize(24pt))

Future development on this point is discussed in Fine grained theme settings · Issue #1458 · GiovineItalia/Gadfly.jl · GitHub.

1 Like

Thanks that does what I needed.