Hello! I’m experimenting with AlgebraOfGraphics
and stumbled upon something I haven’t been able to do. I looks like the default behaviour when plotting categorical variable on the y axis and continuous on the x axis is to order the y axis in ascending lexical order. Instead, I would like to order the y axis in the ascending order of values on the x axis. Is there a way to do this?
using CairoMakie, AlgebraOfGraphics, ColorSchemes
let
df = DataFrame(x = [0.15, 0.13, 0.17], c = ["A", "B", "C"])
plt = data(df) * mapping(:x, :c, color=:c) * visual(markersize=40)
draw(
plt;
axis=(;limits=(0.1, 0.2, nothing, nothing),
xticks=collect(0.1:0.02:0.2))
)
end
The goal is for the y axis to be ordered (ascending) B, A, C.