ggplot: Parsing Expressions

code
beginner
r
ggplot
Author

Daniel Kick

Published

March 9, 2021

A useful trick is to pass expressions into ggplot. Here I’ve used the following as arguments in labs().

c("r11", "r1", "Ihtk.0", "Ihtk.Slope", "Ia.0", "Ia.Slope", "vrest")
c(expression(M\~Omega), expression(M\~Omega), "nA", expression(frac(nA,
mV)), "nA", expression(frac(nA, mV)), "mV" )

image (30).png

You can also do something like this theme(plot.title = element_text(face="italic")) to add italics to the figure title.