I've looked at a number of the solutions to the same question but applied to different datasets, and none seem to work for me.
I'm looking to add metres cubed as the unit for each axis title, with metres cubed obviously showing with an exponent. The latest code I tried (which didn't work) was as follows:
ggplot(data=vol30, aes(x=control, y=vol30)) + geom_point(alpha=.6, size=4, color="#880011") + ggtitle("Ground Survey vs. 30m UAV Survey") + labs(x="Volume, m^{3}", y="Volume, m^{3}") + xlim(0, 5) + ylim(0, 5) + geom_abline(intercept = 0, slope = 1, alpha=.6, size = 1, colour="blue")
I'm new to R and ggplot2, so speak slowly ;) Does anyone have any recommendations?
expression
should be added to labs(x =
x = expression(paste("Volume ", m^{3})), y = expression(paste("Volume ", m^{3}))