Skip to content

Changes in jitter.width of geom_point() since v3.5.1.9000 #6300

Closed
@jbengler

Description

@jbengler

Part 1

In this example the jitter is wider since v3.5.1.9000

ggplot(mtcars, aes(x = factor(cyl), y = disp, color = factor(cyl))) +
  geom_point(
    position = position_jitterdodge(
      jitter.width = 0.4, jitter.height = 0, dodge.width = 0, seed = 42
      )
    )

Output of ggplot2 v3.5.1

Image

Output of ggplot2 v3.5.1.9000

Image

Part 2

Now, it gets even more interesting. If the grouping viable is discrete, but not a factor, the jitter is more narrow since v3.5.1.9000

mtcars %>%
  mutate(new_var = c(rep("A", 11), rep("B", 11), rep("C", 10))) %>%
  ggplot(aes(x = new_var, y = disp, color = new_var)) +
  geom_point(
    position = position_jitterdodge(
      jitter.width = 0.4, jitter.height = 0, dodge.width = 0, seed = 42
    )
  )

Output of ggplot2 v3.5.1

Image

Output of ggplot2 v3.5.1.9000

Image

Conclusion

I am not sure what to make of this. I guess this might probably not hurt too much. However, in tidyplots it triggers a lot of vdiffr failures.

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