qplot - legend text in italics

5.9k views Asked by At

I have created a plot:

p = qplot(distance, Recombination, data = forplot, colour = factor(Species), size=I(4))

p + labs(title="Effective Recombination", x="Distance Categories", y="Effective Recombination Ratio", colour="Species") + ylim(0,0.022)

Screenshot of plot so far

However, I need the legend names (s. mimosarum and s. africanus) to be in italics. How do I do that? I have experimented with using expression and fontface, but I cannot get anything working.

1

There are 1 answers

1
Mateusz1981 On BEST ANSWER

Try sth like that

p + theme(legend.text = element_text(face = "italic"))