You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #1151, Gadfly.jl's current implementation of violin plots (and to a lesser extent, density plots) is fairly limited as compared to our equivalent ecosystems for other languages (e.g. seaborn's violins and ggplot's violins).
Current limitations
Not possible to change orientation of violinplots. The primary grouping currently has to be on the x axis so violins cannot be horizontal.
Major duplication of code between Stat.density and Stat.violin
Three main options for position, (1) :identity: what we do now (2) :stack stack densities on top of each other like we do in Geom.bar (3) :fill normalize such that for each position along the densities, the total always equals 1
Not possible to adjust scaling of density plots, i.e. all Gadfly violins/density plots always have an area of 1. It would help to add the option of using unnormalized counts.
Currently impossible to group violins according to a 2nd variable (e.g. group by color and x)
This would need to be a generalization of @Mattriks' solution in Geom.violin with color #1081. Essentially, there are four cases: (1) if no color aesthetic is mapped, then use the default_color (2) if there is a 1 to 1 mapping between the color aesthetic and the primary grouping (e.g. the x categorical variable) then use the solution in Geom.violin with color #1081, (3) if there isn't a 1 to 1 mapping and fewer colors than x groupings then also use solution Geom.violin with color #1081 (4) group by primary variable, then by color (allowing split violins).
Several inefficiencies with the code (we could do quite a bit of preallocation that we don't do related to the KDE since we know how many datapoints there will be in advance)
Examples
Case
Example solution
Split violin grouped by x, color. Uses raw counts, area ≠ 1
Case (3) for violin plots from above
Horizontal violins
Use raw counts
Stacked densities
Filled densities
The text was updated successfully, but these errors were encountered:
This PR needs quite a bit of work since we went through the whole 1.0 revamp since then. I'll eventually get to it if no one gets to it first. Bit swamped right now.
As discussed in #1151,
Gadfly.jl
's current implementation of violin plots (and to a lesser extent, density plots) is fairly limited as compared to our equivalent ecosystems for other languages (e.g. seaborn's violins and ggplot's violins).Current limitations
Not possible to change orientation of violinplots. The primary grouping currently has to be on the x axis so violins cannot be horizontal.
Major duplication of code between
Stat.density
andStat.violin
ggplot2
is able to build on the same code.Not possible to stack densities
:identity
: what we do now (2):stack
stack densities on top of each other like we do inGeom.bar
(3):fill
normalize such that for each position along the densities, the total always equals 1Not possible to adjust scaling of density plots, i.e. all Gadfly violins/density plots always have an area of 1. It would help to add the option of using unnormalized counts.
Currently impossible to group violins according to a 2nd variable (e.g. group by
color
andx
)x
categorical variable) then use the solution in Geom.violin with color #1081, (3) if there isn't a 1 to 1 mapping and fewer colors than x groupings then also use solution Geom.violin with color #1081 (4) group by primary variable, then by color (allowing split violins).Several inefficiencies with the code (we could do quite a bit of preallocation that we don't do related to the KDE since we know how many datapoints there will be in advance)
Examples
Fill
ed densitiesThe text was updated successfully, but these errors were encountered: