Skip to content

Set size of 2 plotting issue. #86

@micahgearhart

Description

@micahgearhart

Reposting from stackoverflow as I believe this is a bug.

A few of my sets for my plot only have two values and geom_density_ridges draws the categorical labels on the y-axis but doesn't plot any data. geom_violin, on the other hand, works fine with a set size of 2. Also, if I add jittered points to the plot they are not drawn for the n=2 sets.

Reproducible example:

df<-data.frame(class=factor(c("a","a","a","b","b")),value=c(2,4,5,2,3))
ggplot(df,aes(y=class,x=value)) + geom_violin()
ggplot(df,aes(y=class,x=value)) + geom_density_ridges()

sessionInfo:

R version 4.2.2 (2022-10-31)
ggplot2_3.4.2
ggridges_0.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions