Commit f5668f58 authored by houyun's avatar houyun
Browse files

shade marker

parent 739a5272
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -245,7 +245,8 @@ marker2grob <- function(x, r = 0, n = 100, ratio = 0.618) {
            ellipse = ellipseGrob(r = r, nstep = 100),
            cross = crossGrob(),
            triangle = triangleGrob(1),
            triangle2 = triangleGrob(2)
            triangle2 = triangleGrob(2),
            shade = shadeGrob()
    )
  }
}
@@ -306,6 +307,13 @@ crossGrob <- function() {
  grid::pathGrob(x = x, y = y, id = id)
}

#' @noRd
shadeGrob <- function() {
  x <- c(0, 0, 0.5, 0.5, 1, 1)
  y <- c(0.5, 0, 0, 1, 1, 0.5)
  grid::pathGrob(x = x, y = y, id = rep(1:3, 2))
}

#' @noRd
heartGrob <- function(nstep = 300) {
  tt <- seq(0, 2 * pi, length.out = nstep)
@@ -373,7 +381,7 @@ rename_grob <- function (grobs, prefix = "MARKER", suffix = "GRID")

#' @noRd
all_type <- c("square", "circle", "star", "heart", "ellipse", "cross",
              "triangle", "triangle2")
              "triangle", "triangle2", "shade")

#' @noRd
as_marker <- function(x, ...) {