Skip to content

Commit

Permalink
ggplot2 legend change
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmyleswhite committed Sep 16, 2012
1 parent 6af199c commit 1586746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 02-Exploration/chapter02.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ ggplot(heights.weights[1:2000, ], aes(x = Height, y = Weight)) +
# Visualize how gender depends on height and weight.
ggplot(heights.weights, aes(x = Height, y = Weight)) +
geom_point(aes(color = Gender, alpha = 0.25)) +
scale_alpha(legend = FALSE) +
scale_alpha(guide = "none") +
scale_color_manual(values = c("Male" = "black", "Female" = "gray")) +
theme_bw()

Expand All @@ -393,7 +393,7 @@ logit.model <- glm(Male ~ Weight + Height,

ggplot(heights.weights, aes(x = Height, y = Weight)) +
geom_point(aes(color = Gender, alpha = 0.25)) +
scale_alpha(legend = FALSE) +
scale_alpha(guide = "none") +
scale_color_manual(values = c("Male" = "black", "Female" = "gray")) +
theme_bw() +
stat_abline(intercept = -coef(logit.model)[1] / coef(logit.model)[2],
Expand Down

0 comments on commit 1586746

Please sign in to comment.