Commit c4df0088 authored by houyun's avatar houyun
Browse files

remove richtext

parent 4f01e9f7
Loading
Loading
Loading
Loading
+9 −25
Original line number Diff line number Diff line
#' Create the default hyplot theme
#' @title hyplot theme
#' @param ... extra params passing to \code{\link[ggplot2]{theme}}.
#' @param use_md logical. if TRUE, will use \code{ggtext::element_markdown()} to
#' draw the axis labels.
#' @return The theme.
#' @importFrom ggplot2 theme
#' @importFrom ggplot2 element_text
@@ -10,9 +8,8 @@
#' @rdname theme_hy
#' @author Hou Yun
#' @export
theme_hy <- function(..., use_md = FALSE)
theme_hy <- function(...)
{
  if(isFALSE(use_md)) {
  theme(
    axis.text = element_text(size = 10.5, colour = "black"),
    axis.title = element_blank(),
@@ -21,17 +18,4 @@ theme_hy <- function(..., use_md = FALSE)
    axis.text.x.bottom = element_text(angle = 90, hjust = 1, vjust = 0.5),
    ...
  )
  } else {
    element_markdown <- get_function("ggtext", "element_markdown")
    theme(
      axis.text = element_markdown(size = 10.5, colour = "black"),
      axis.title = element_blank(),
      axis.line = element_blank(),
      axis.text.y.left = element_markdown(),
      axis.text.y.right = element_markdown(),
      axis.text.x.top = element_markdown(angle = 90, hjust = 0, vjust = 0.5),
      axis.text.x.bottom = element_markdown(angle = 90, hjust = 1, vjust = 0.5),
      ...
    )
  }
}
+1 −4
Original line number Diff line number Diff line
@@ -4,13 +4,10 @@
\alias{theme_hy}
\title{hyplot theme}
\usage{
theme_hy(..., use_md = FALSE)
theme_hy(...)
}
\arguments{
\item{...}{extra params passing to \code{\link[ggplot2]{theme}}.}

\item{use_md}{logical. if TRUE, will use \code{ggtext::element_markdown()} to
draw the axis labels.}
}
\value{
The theme.