Add Subscript & Superscript to Labels of ggplot2 Facet Plot in R | labeller Argument in facet_wrap

preview_player
Показать описание
R code of this video:

y = 1:4,
facets = c("AAA^15",
"BBB[2]",
"CCC[3]^2",
"DDD[4]^EEE[5]"))

library("ggplot2")

ggplot(data, aes(x, y)) + # Draw facet plot without subscript/superscript
geom_point() +
facet_wrap(facets ~ .)

ggplot(data, aes(x, y)) + # Draw facet plot with subscript/superscript
geom_point() +
facet_wrap(facets ~ .,
labeller = label_parsed)

Follow me on Social Media:

Рекомендации по теме
welcome to shbcf.ru