diff --git a/R/aes-linetype-size-shape.r b/R/aes-linetype-size-shape.r index 2dd59d48b3..9199c7cf31 100644 --- a/R/aes-linetype-size-shape.r +++ b/R/aes-linetype-size-shape.r @@ -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 diff --git a/man/aes_linetype_size_shape.Rd b/man/aes_linetype_size_shape.Rd index f29af0f360..1c6445172c 100644 --- a/man/aes_linetype_size_shape.Rd +++ b/man/aes_linetype_size_shape.Rd @@ -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") }