I'm trying to plot a function of two variables using the persp()
function in R. This is what I have so far:
C_unab <- function(u1, u2) {
return(u1 * u2)
}
x <- seq(0, 1, by = 0.1)
y <- seq(0, 1, by = 0.1)
z_1 <- outer(x,y, C_unab)
persp(x, y, z_1, theta = -60, phi = 25 ,shade = 0.7,expand = 0.8 , ltheta = -60, ticktype = "detailed",
xlab = "u1", ylab = "u2", zlab = "Phi", col="lightblue")
This works fine. However, I would like the "1" and "2" that appear in the axis labels to be subscripted (i. e. as indices). I've looked around and found "plotmath". However that doesn't seem to work for pesp()
and the documentation says:" Expressions can also be used for titles, subtitles and x- and y-axis labels (but not for axis labels on persp plots)."
I've also done a search around here but haven't found anything that works for me.
Any help would be appreciated!