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

Add order= parameter

Open adkabo opened this issue 2 years ago • 1 comments

Currently the plot depends on row order which leads to weird plots. So I have to sort the data before putting it into AoG. I don't like that the algebra depends on the row order. Instead I would like an order parameter in the mapping.

using DataFrames, RDatasets, AlgebraOfGraphics

diamonds = dataset("ggplot2", "diamonds")

data(diamonds) * mapping(:X, :Price) * visual(Lines) |> draw

data(sort(diamonds, :X)) * mapping(:X, :Price) * visual(Lines) |> draw

data(diamonds) * mapping(:X, :Price, order=:X) * visual(Lines) |> draw

image

image

adkabo avatar Aug 10 '21 19:08 adkabo

This may be related to Issue #262.

roland-KA avatar Aug 17 '21 14:08 roland-KA