r – Using Unicode character (plus minus sign) inside ggplot2

r – Using Unicode character (plus minus sign) inside ggplot2

here are two ways:

ggplot(df, aes(x = Rated_Movement, y = Rater, fill = Error)) + 
  geom_tile(color = black, size = 0.5, alpha = 0.8)+
  geom_text(aes(label = paste(±, round(Error,2))))+
  scale_fill_gradientn(colours = terrain.colors(10))+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())

ggplot(df, aes(x = Rated_Movement, y = Rater, fill = Error)) + 
  geom_tile(color = black, size = 0.5, alpha = 0.8)+
  geom_text(aes(label = paste(u00B1, round(Error,2)))) +
  scale_fill_gradientn(colours = terrain.colors(10))+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())

enter

r – Using Unicode character (plus minus sign) inside ggplot2

Leave a Reply

Your email address will not be published. Required fields are marked *