AlgebraOfGraphics.jl icon indicating copy to clipboard operation
AlgebraOfGraphics.jl copied to clipboard

Function to manage plot title?

Open kir0ul opened this issue 3 years ago • 3 comments

It would be nice to have the option to add or change the main title of the plot, something like ggtitle in ggplot2 or like the title property in Vega-Lite. I believe there's no official way to do this yet or at least I couldn't find anything in the docs.

Thanks for this awesome package!

kir0ul avatar Jan 29 '22 18:01 kir0ul

With the axis keyword you can pass options to Makie's Axis object, which includes a title option, so you can write draw(..., axis=(; title="My title")).

knuesel avatar Jan 29 '22 18:01 knuesel

This, however, will not work together with faceting. There should be such an option that works even when faceting.

greimel avatar Jan 31 '22 14:01 greimel

I also ran into the issue with faceting. It's not a great solution, but you can add your own Label like so:

plt = draw(...)  # suppose this has two columns.
Makie.Label(plt.figure[0, 1:2], "Title text";
            fontsize=20, font=:bold)

RomeoV avatar Jul 28 '23 01:07 RomeoV