Skip to content
julia
using GLMakie, PalmerPenguins, DataFrames
using AlgebraOfGraphics
import AlgebraOfGraphics as AoG

GLMakie.activate!()

function getPenguins()
    # ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
    penguins = dropmissing(DataFrame(PalmerPenguins.load()))
    return penguins
end

penguins = getPenguins()
# declare new plot attributes
palette = (color=tuple.(["#FC7808", "#8C00EC", "#107A78"], 0.65),
    marker=[:circle, :utriangle, :rect])
cycle = Cycle([:color, :marker], covary=true)

p_len  = data(penguins)
p_len *= AoG.density()
p_len *= mapping(:flipper_length_mm => (t -> t / 10), color=:species)

with_theme(theme_light(),size = (600,400), palette=palette, Scatter=(cycle=cycle,)) do
    p_len |> draw
end

julia
p_len  = data(penguins)
# p_len = AoG.density()
p_len *= mapping(:flipper_length_mm, color=:species)
p_len *= AoG.density()
p_len *= visual(direction=:y, offset = 1.0, # direction is not working!
    alpha = 0.2, strokewidth = 1.5, strokecolor = :grey20)
draw(p_len)