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

Improvements for documentation of shapes #717

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 15 additions & 9 deletions R/aes-linetype-size-shape.r
Expand Up @@ -55,14 +55,20 @@
#' # Shape can also be mapped from a variable
#' p + geom_point(aes(shape = factor(cyl)))
#'
#' # A look at all 25 symbols
#' df2 <- data.frame(x = 1:5 , y = 1:25, z = 1:25)
#' s <- ggplot(df2, aes(x = x, y = y))
#' s + geom_point(aes(shape = z), size = 4) + scale_shape_identity()
#' # While all symbols have a foreground colour, symbols 19-25 also take a
#' # A look at all 26 symbols
#' df2 <- data.frame(x = 1, y = 1, z = 0:25)
#' s <- ggplot(df2, aes(x = x, y = y)) +
#' scale_x_continuous(breaks=c(1)) +
#' scale_y_continuous(breaks=c(1)) +
#' scale_shape_identity() +
#' facet_wrap(~z) +
#' theme_bw() +
#' theme(axis.text = element_blank(),
#' axis.title = element_blank(),
#' axis.ticks = element_blank())
#' s + geom_point(aes(shape = z), size = 10)
#' # While all symbols have a foreground colour, symbols 21-25 also take a
#' # background colour (fill)
#' s + geom_point(aes(shape = z), size = 4, colour = "Red") +
#' scale_shape_identity()
#' s + geom_point(aes(shape = z), size = 4, colour = "Red", fill = "Black") +
#' scale_shape_identity()
#' s + geom_point(aes(shape = z), size = 10, colour = "Red")
#' s + geom_point(aes(shape = z), size = 10, colour = "Red", fill = "lightblue")
NULL
24 changes: 15 additions & 9 deletions man/aes_linetype_size_shape.Rd
Expand Up @@ -56,15 +56,21 @@ p + geom_point(shape = NA)
# Shape can also be mapped from a variable
p + geom_point(aes(shape = factor(cyl)))

# A look at all 25 symbols
df2 <- data.frame(x = 1:5 , y = 1:25, z = 1:25)
s <- ggplot(df2, aes(x = x, y = y))
s + geom_point(aes(shape = z), size = 4) + scale_shape_identity()
# While all symbols have a foreground colour, symbols 19-25 also take a
# A look at all 26 symbols
df2 <- data.frame(x = 1, y = 1, z = 0:25)
s <- ggplot(df2, aes(x = x, y = y)) +
scale_x_continuous(breaks=c(1)) +
scale_y_continuous(breaks=c(1)) +
scale_shape_identity() +
facet_wrap(~z) +
theme_bw() +
theme(axis.text = element_blank(),
axis.title = element_blank(),
axis.ticks = element_blank())
s + geom_point(aes(shape = z), size = 10)
# While all symbols have a foreground colour, symbols 21-25 also take a
# background colour (fill)
s + geom_point(aes(shape = z), size = 4, colour = "Red") +
scale_shape_identity()
s + geom_point(aes(shape = z), size = 4, colour = "Red", fill = "Black") +
scale_shape_identity()
s + geom_point(aes(shape = z), size = 10, colour = "Red")
s + geom_point(aes(shape = z), size = 10, colour = "Red", fill = "lightblue")
}