R/geom_bubble.R

Defines functions geom_bubble

Documented in geom_bubble

#' geom_bubble
#' @description Like geom point but has a rim and a filling
#'
#' @param fill character string color name or hexidecimal entry
#' @param ...
#'
#' @return a ggplot2 layer
#' @export
#'
#' @examples
#' # without function
#' library(ggplot2)
#' ggplot(cars) +
#'   aes(x = speed, y = dist) +
#'   geom_point(shape = 21,size = 7,
#'     alpha = .85,
#'     color = "white",
#'     fill = "plum2")
#'
#'  geom_bubble
#'
#' # using function
#' library(ggplot2)
#' ggplot(cars) +
#'   aes(x = speed, y = dist) +
#'   geom_bubble(size = 7,
#'     alpha = .85,
#'     color = "white",
#'     fill = "plum2"
#'    ) +
#'  theme_minimal()
#'
#'
geom_bubble <- function(fill = "grey35", ...)  {
  geom_point(shape = 21, fill = fill, ...)
}
EvaMaeRey/ggdirect documentation built on Sept. 29, 2023, 12:36 a.m.