R/show_point_shapes.R

Defines functions show_point_shapes

Documented in show_point_shapes

#' @include utilities.R
NULL
#' Point shapes available in R
#' @description Show point shapes available in R.
#' @return a ggplot.
#'
#' @seealso \code{\link{ggpar}} and \code{\link{ggline}}.
#' @examples
#' show_point_shapes()+
#'  theme_minimal()
#' @export
show_point_shapes <- function()
{
  d=data.frame(p=c(0:25))
  p <- ggplot() +
    scale_y_continuous(name="") +
    scale_x_continuous(name="") +
    scale_shape_identity() +
    geom_point(data=d, mapping=aes(x=p%%6, y=p%/%6, shape=p), size=5, fill="blue") +
    geom_text(data=d, mapping=aes(x=p%%6, y=p%/%6+0.25, label=p), size=3)+
    scale_y_reverse() +
    theme(
      axis.title = element_blank()
    )
  ggpar(p, ticks = FALSE, tickslab = FALSE,
        main = "Point shapes available in R")
}

Try the ggpubr package in your browser

Any scripts or data that you put into this service are public.

ggpubr documentation built on Feb. 16, 2023, 7:18 p.m.