Skip to content
Prev 395213 / 398502 Next

Is it possible to get a downward pointing solid triangle plotting symbol in R?

?s 10:09 de 06/10/2023, Chris Evans via R-help escreveu:
Hello,

Maybe you can solve the problem with unicode characters.
See the two scale_*_manual at the end of the plot.



# Unicode characters for black up- and down-pointing characters
pts_shapes <- c("\U25B2", "\U25BC") |> setNames(c("A", "B"))
pts_colors <- c("blue", "red") |> setNames(c("A", "B"))

ggplot(data = tmpTibAreas,
        aes(x = x, y = y)) +
   geom_polygon(data = tmpTibAreas,
                aes(x = x, y = y, fill = a)) +
   geom_point(data = tmpTibPoints,
              aes(x = x, y = y, color = c, shape = c),
              size = 6) +
   scale_shape_manual(values = pts_shapes) +
   scale_color_manual(values = pts_colors)