0

I'd like to use "pentagon" shape for my geom_point() graph. But I can't.. Is it the font problem?

My code is as follow:

grp <- ggplot(data = whole.df, aes(x = whole.df[ ,tar.in], y = whole.df[, tar.y]))+
      geom_point(aes(shape = Diet_Case), size =3)+
      theme_classic()+
      scale_shape_manual(values = c("Diet1" = "\u25a1", "Diet2" = "\u25cb", "Diet3" = "\u25b3", "Diet4" = "\u25bd", "Diet5" = "\u25c7", "Diet6" = "\u2b20"))+
      geom_point(aes(x = xpivot.Diet1, y = ypivot.Diet1), color = "black", shape = "\u25a0", size = 3)+
      geom_point(aes(x = xpivot.Diet2, y = ypivot.Diet2), color = "black", shape = "\u25cf", size = 3)+
      geom_point(aes(x = xpivot.Diet3, y = ypivot.Diet3), color = "black", shape = "\u25b2", size = 2.5)+
      geom_point(aes(x = xpivot.Diet4, y = ypivot.Diet4), color = "black", shape = "\u25bc", size = 2.5)+
      geom_point(aes(x = xpivot.Diet5, y = ypivot.Diet5), color = "black", shape = "\u25c6", size = 3)+
      geom_point(aes(x = xpivot.Diet6, y = ypivot.Diet6), color = "black", shape = "\u2b1f", size = 3)+
      xlab(sprintf("%s", tar.in.unit))+
      ylab(sprintf("%s", tar.y.unit))+
      theme(text = element_text(size=8, color = "black", family = "serif"),
      axis.text.x = element_text(size=8, color = "black", family = "serif"),
      axis.text.y = element_text(size=8, color = "black", family = "serif"))

What I would like to express with Pentagon is 'Diet6'. I tried using "\u2b20" and "\u2b1f" as Unicode, but they don't display properly. enter image description here

S. Jeon
  • 5
  • 2
  • 1
    Side note, if you find yourself repeating the geoms, it is most likely your data needs reshaping from [wide-to-long](https://stackoverflow.com/q/4877357/680068) before plotting. – zx8754 Apr 25 '23 at 07:30

0 Answers0