[ANN] AlgebraOfGraphics v0.10 (and v0.9 & v0.8)

I noticed I didn’t make posts for the last two versions either, so I’m going to catch up a bit here. If you have tried AoG more than a year ago and found it lacking for your needs, maybe now’s a good time to have another look at it.

I’m just going backwards in time, picking some more salient changes along the changelog


v0.10 adds the ability to have multiple colorbars for the same figure, and the ability to represent categorical color scales with colorbars as well, which is by default used for the Bin scale that filled_contours produces:

The wrapped palette function gives more control over the shape that layout produces:

There’s now support for units via Unitful.jl or DynamicQuantities.jl:

Histograms can be easily drawn in stair form

The mergeable function was refactored so that SwarmMakie can correctly draw swarm plots with AoG

Pagination was refactored such that all scales are resolved before pagination. Therefore colors are now consistent across pages, note how the two pages here share the same legend even though not every category exists on each page:

Multiple X and Y scales can now be used within one plot, as long as no facet uses more than one of each

Plots can simply be labelled without having a scale, by adding visual(label = ...):

Figure options allow easy setting of title, subtitle and footnotes without needing to use Makie layouting directly:

The generic dodge_x and dodge_y mappings allow dodging all plot types by modifying their input data, this allows for the common “barplot + errorbar” scenario, for example:

The from_continuous helper makes it easier to use continuous colormaps for categorical plots:

using AlgebraOfGraphics
using CairoMakie

spec = data((; x = 1:10, y = 1:10, z = 'A':'J')) *
    mapping(:x, :y, color = :z) *
    visual(BarPlot)

f = Figure()
fg1 = draw!(f[1, 1], spec, scales(Color = (; palette = :viridis)))
legend!(f[1, 2], fg1)
fg2 = draw!(f[1, 3], spec, scales(Color = (; palette = from_continuous(:viridis))))
legend!(f[1, 4], fg2)
f

Strings are sorted in natural sort order, so a 10 comes after a 9 if it appears in a string, not like here, where the 10 comes between 1 and 2

And, finally, all the way back since v0.8, missings do not cause data to be interpreted as categorical anymore. Instead, they are converted to NaN in the plotting primitives, like Makie does it.

That’s all for now, happy plotting!

34 Likes

Thanks for the awesome release !

The changelog link is broken. Gives 404 on my end.

Thanks, that’s weird but I replaced it with a versioned link now

1 Like

Unit support would be super welcome in Makie.jl itself too.

2 Likes

Amazing! Thank you.

Unit support in Makie already exists, it just currently works a bit differently because the unit labels go into the ticks. Maybe going into the axis label can be something to configure in the future, though.

1 Like

There are issues with various plots when it comes to unit support, and I remember opening some of them. I will cc’you on github when I find them.

Your comment sounded like you thought there was no unit support at all, I’m aware of the issues, no need to cc me :slight_smile:

2 Likes

Awesome work! Really appreciate all the excellent improvements, AlgebraOfGraphics is such a joy to work with after all the recent work that has gone into it. It was good before, but so much better now.

2 Likes