R/show_line_types.R

Defines functions show_line_types

Documented in show_line_types

#' @include utilities.R ggpar.R
NULL
#' Line types available in R
#' @description Show line types available in R.
#' @return a ggplot.
#'
#' @seealso \code{\link{ggpar}} and \code{\link{ggline}}.
#' @examples
#' show_line_types()+
#'  theme_minimal()
#' @export
show_line_types <- function()
{
  lt <- c("blank", "solid", "dashed",  "dotted",
          "dotdash", "longdash", "twodash")

  d <- data.frame(lt = factor(lt, levels = lt))

  ggplot() +
    scale_x_continuous(name="", limits=c(0,1), breaks=NULL) +
    scale_linetype_identity() +
    geom_segment(data=d, mapping=aes(x=0, xend=1, y=lt,
                                     yend=lt, linetype=lt))+
    labs(title = "Line types available in R", y = "")+
    theme(axis.text.y = element_text(face="bold", color="black"))
}

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.