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

ggplot2 boxplot dotSize #1

Open
ghost opened this issue Jul 3, 2015 · 1 comment
Open

ggplot2 boxplot dotSize #1

ghost opened this issue Jul 3, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 3, 2015

It would be nice if dotSize could accept a variable name (aesthetic mapping).

Is there a way to get the generated ggplot command that your functions create?

@kassambara
Copy link
Owner

Thank you for this suggestion. The easyGgplot2 package is under intensive modifications in order to simplify the package and to add many other options.

Pending new verision of easyGgplot2 , I suggest the following quick-start-guides to customize your boxplot and/or your dotplot with ggplot2:

Load ggplot2

library("ggplot2")

Prepare the data

# Load data
data(ToothGrowth)
# Convert the variable dose from a numeric to a factor variable
ToothGrowth$dose <- as.factor(ToothGrowth$dose)

Combine box plot and dot plot

# Default plot
ggplot(ToothGrowth, aes(x=dose, y=len)) + 
  geom_boxplot(notch = TRUE)+
  geom_dotplot(binaxis='y', stackdir='center')

# Change dot size using numeric value
ggplot(ToothGrowth, aes(x=dose, y=len)) + 
  geom_boxplot(notch = TRUE)+
  geom_dotplot(binaxis='y', stackdir='center', dotsize = 1.5)

rplot

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

No branches or pull requests

1 participant