-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
Codecov Report
@@ Coverage Diff @@
## master #107 +/- ##
===========================================
- Coverage 76.8% 45.98% -30.83%
===========================================
Files 16 21 +5
Lines 444 759 +315
===========================================
+ Hits 341 349 +8
- Misses 103 410 +307
Continue to review full report at Codecov.
|
@piever or someone else, perhaps you can advise on a good way to go about making a stacked plot like the one below from ggplot2: ggplot(mtcars, aes(x = mpg, fill = factor(cyl))) +
geom_dotplot(stackgroups = TRUE, binwidth = 1, binpositions = "all") In this case, the grouping is done by the categorical variable julia> using Makie, StatsMakie, RDatasets
julia> dotplot(Data(mtcars), Style(color=:Cyl), :MPG; orientation = :horizontal, stackdir = :up) But this is a hack since Which of these three syntaxes is most consistent with StatsMakie's grammar? julia> dotplot(Position.stack, Data(mtcars), Group(color=:Cyl), :MPG; orientation = :horizontal, stackdir = :up)
julia> dotplot(Data(mtcars), Group(color=:Cyl, stack=:Cyl), :MPG; orientation = :horizontal, stackdir = :up) # redundant
julia> dotplot(Data(mtcars), Group(color=:Cyl), :MPG; orientation = :horizontal, stackdir = :up, stackgroups = true) # similar to ggplot2 Another complication is that we have different stages where we might want to bin (via a parameter like
2 and 4 can happen within the recipe, but I don't know how to do 1. and 3. yet, since they'll need to happen outside the recipe. |
I've assigned this PR to the Vizcon project so we can discuss it there |
Awesome! |
This seems very similar to the On the technical side, I think you are bringing up a bit of a tricky issue, as the current infrastructure with What I'm wondering is whether the "grouping framework" should maybe also put the data back together, with the correct attributes called column-wise. In that case you would do something like Alternatively, note that you could always overload this for |
I'm working on a refactor. A "dot plot" has two main parts. The first is a set of algorithms for creating what I'm calling The second part is a With a default conversion of plot(tally, x) # Make 2D dot plot with :dotdensity method and stacks
plot(tally(method = :histodot), x) # make :histodot plot with stacks
stacks(histogram, x) # same as above
barplot(tally, x) # plot tally similarly to histogram Finally, to get the convenient centering, stacking, and dodging behavior of the familiar dot plot, a |
This got way too general when I tried to support 3D dot plots, it's now stale, and I don't intend to revisit it any time soon, so I'm closing. |
Ah pitty! I hope we can revive the code later! :) |
This PR will implement a
dotplot
a lageom_dotplot
in ggplots2. It currently only implements the "dot density" (Wilkinson) plot type but will (probably) eventually useAnalysis
to support different binnings of dots including "histodot".Some examples so far
Some to-dos/questions I'd appreciate input on:
violin
andboxplot
(relates BoundsError with violin and boxplot using Data #60)markersize
should scale so dots still stack)How to change theme defaults based on type (e.g. if a single x-position, default to horizontal and non-centered)Refactor to only handle binned dots indotplot
and provideAnalysis
typesdotdensity
andhistodot
for doing the binningMake not providing anAnalysis
default todotdensity
mode somehowquantiles
Analysis
type for quantile dotplots. It just computes the ECDF on the data, which it uses to uniformly sample dots on the quantiles, which can then be passed todotplot
.width
in data units, so they take up roughly the same space as e.g. a violin plot.