TidierOrg / TidierPlots.jl

Tidier data visualization in Julia, modeled after the ggplot2 R package.
MIT License
196 stars 7 forks source link

Reimplement facet_grid and facet_wrap #67

Closed rdboyes closed 1 month ago

rdboyes commented 3 months ago

Transition to Makie.jl as a backend completely broke facet functions. They will need to be reimplemented from scratch

rdboyes commented 1 month ago

Initial implementation of facet_wrap working in dev:

df = mapreduce(vcat, 1:4) do i 
    DataFrame(
        x=collect(1:100),
        y=cumsum(randn(100)),
        g=fill(string(i), 100)
    )
end

ggplot(df, aes(x=:x, y=:y)) + geom_line() + facet_wrap(:g)

image

rdboyes commented 1 month ago

facet_wrap is complete, including nrow, ncol, and scales (supporting free_x, free_y, free, and fixed), with automatic facet labelling:

ggplot(df, aes(x=:x, y=:y, color = :g)) + geom_line() + facet_wrap(:g, nrow = 2, ncol = 2)

image