Skip to content

geom_dotplot() with continuous x variable and a categorical y variable. #5462

@retodomax

Description

@retodomax

I found a problem with geom_dotplot() if I provide a continuous x variable and a categorical y variable.

I expected a plot as the following but with reversed x and y axis.

library(ggplot2)
ggplot(data = iris) +
  geom_dotplot(aes(y = Sepal.Length, x = Species), binaxis = "y")

Instead, I got the following

ggplot(data = iris) +
  geom_dotplot(aes(x = Sepal.Length, y = Species), binaxis = "x")

The dots start at the bottom instead of at the corresponding species level (y-axis).

Created on 2023-10-09 with reprex v2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions