Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup in stat_sina() code, and remove limitation on maxwidth #76

Merged
merged 1 commit into from
Aug 18, 2017
Merged

Cleanup in stat_sina() code, and remove limitation on maxwidth #76

merged 1 commit into from
Aug 18, 2017

Conversation

clauswilke
Copy link
Contributor

This pull request does two things:

  1. It cleans up some code in stat_sina that makes no sense. In two cases, if/else codepaths execute the exact same code, so there's no need for the if/else construct.

  2. It removes the artificial limit on the maxwidth parameter. I provide an example below for a situation where maxwidth > 1 is appropriate.

n <- 200
y1 <- rnorm(n, mean = 5, sd = 3.5)
y2 <- rnorm(n, mean = 12, sd = .4)
y3 <- rnorm(n, mean = 3.5, sd = 2)

df <- data.frame(y = c(y1, y2, y3), x = rep(c("A", "B", "C"), each = n))

ggplot(df, aes(x, y)) + stat_sina(maxwidth = 1.5)

screen shot 2017-08-13 at 1 56 49 pm

@thomasp85
Copy link
Owner

Looks good - thanks

@thomasp85 thomasp85 closed this Aug 18, 2017
@thomasp85 thomasp85 reopened this Aug 18, 2017
@thomasp85 thomasp85 merged commit 2f65b76 into thomasp85:master Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants