I am using ggplot2 to make a plot with species name as y axis labels, such as:
data_1 <- data.frame(
name = c("1_Enterococcus faecalis_ab1", "3_Bifidobacterium longum_ab2", "5_Bifidobacterium breve_ab12"),
value = c(1, 3, 5)
)
data_2 <- data.frame(
name = c("1_Enterococcus faecalis_ab1", "3_Bifidobacterium longum_ab2", "5_Bifidobacterium breve_ab12"),
value = c(3, 5, 3)
)
ggplot()+geom_point(data=data_1,aes(x=value,y=name))+geom_point(data=data_2,aes(x=value,y=name))
I want to make the italic species name in the y labels like 1_Enterococcus faecalis_ab1. I see the answer from R ggplot2 using italics and non-italics in the same category label, but still cannot make it.
Any idea to do it? Thanks