The symbol "β‰₯" or "≀" in the ggplot2 legend

I draw a graph with ggplot2, and I want to put arithmetic symbols in legend labels (or somewhere else in this case), for example "β‰₯". I tried the coding line expression(x>=y) , which works well, but I don't need the character before or after "β‰₯". For example, with the following code:

 library(ggplot2) mtcars$carb <- factor(mtcars$carb) ggplot(mtcars, aes(wt, mpg, group=carb)) + geom_point(aes(colour=carb), size=4) + scale_colour_discrete(labels=c(expression(x>=y), "2", "3", "4", "6", "8")) 

I get it

enter image description here

but i want it.

enter image description here

Is there any way to do this?

+6
source share

All Articles