-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviormessagesrequests for improvements to error, warning, or feedback messagesrequests for improvements to error, warning, or feedback messagespositions 🥇
Description
If position_dodge2(width = 0)
is used with the position
argument in geom_point()
(one?) is wrongly placed horizontally (i. e., wrong 'column' for discrete values). This only seems to be an issue if width = 0
.
If position_dodge2()
is not intended to be used with geom_point()
a warning would be helpful.
library(tidyverse)
df <- tribble(~dimension, ~group, ~value,
"dim 1", "A", 0.6,
"dim 1", "B", 0.7,
"dim 2", "A", 0.4,
"dim 2", "B", 0.5)
plot <- ggplot(data = df,
mapping = aes(x = dimension,
y = value,
color = group))
# point in wrong column (point of 'dim 1' 'B' appears in column of 'dim 2'
plot + geom_point(
position = position_dodge2(width = 0))
# correct column
plot + geom_point(
position = position_dodge2(width = 0.5))
Created on 2021-01-26 by the reprex package (v0.3.0)
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviormessagesrequests for improvements to error, warning, or feedback messagesrequests for improvements to error, warning, or feedback messagespositions 🥇