I'm plotting stable isotope data in R with the ggplot2 package and wish to have the lowercase delta symbols on the axis titles printed in italics. I am using expression() to build the axis titles but the delta symbol will not print in italics when called as 'delta' or prints as d if i use unicode'\u03B4'
A little background: The symbol delta (δ) is a legitimate SI quantity symbol and therefore should always be printed in italic font. See Coplen, T. B. (2011). Guidelines and recommended terms for expression of stable-isotope-ratio and gas-ratio measurement results. Rapid Communications in Mass Spectrometry, 25(17), 2538-2560. doi:10.1002/rcm.5129 https://onlinelibrary.wiley.com/doi/full/10.1002/rcm.5129
Some reproducible code:
require(ggplot2)
set.seed(20)
df <- data.frame(d13C = rnorm(20, -23, 5),
DIC = rnorm(20, 4, 0.2),
d13CDIC = rnorm(20, -8, 2))
ggplot(df, aes(x = d13C, y = d13CDIC)) +
geom_point(aes(fill = DIC), pch = 21, cex = 5) +
labs(x = expression(italic(delta)^13*C~("\211"~VPDB)),
y = expression(italic("\u03B4")^13*C[DIC]~("\211"~VPDB))) +
theme_bw()
And a follow-up question: How do i go about saving the plot to a svg device? It plots correctly when using ggsave to save to .png. However i get the following error when plotting to a .svg device:
ggsave(filename = 'isotope_plot.svg', width = 5, height = 3, units = "in")
Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, : Metric information not available for this family/device