我想在z轴上有希腊字母pi(t),在x轴上有kappa和sigma_0。这是我试过的。我试过unicode但它不会工作。这是我的代码。
library(plot3D)
#check up unicode for greek letters for persp function which doesnt use simbols
T <- 40
r <- 0.02
rho <- -0.6
theta <- 0.3
w <- 100
w0 <- 20
P <- 1.0
a <- 1.0
gamm <- 0.05
t <- 10
prop <- function(k, sigma0){
theta * (w - w0 - T) * exp(-r * (T - t)) *
(k + theta * sigma0 * rho * exp(-(k + theta * sigma0 * rho * (T - t)))) /
(gamm * (k + theta * sigma0 * rho) * (w - w0 - t))
}
k <- seq(5, 10, length= 10)
sigma0 <- seq(0.1, 0.9, length= 10)
z <- outer(k, sigma0, prop)
persp3D(k, sigma0, z, theta = 30, phi = 0, border = "black",
ticktype = "detailed", xlab = "k",ylab = "sigma_0",
zlab ="pi(t)")
text3D(2, -5, 0, labels = expression(sigma[0]), add = TRUE, adj = 1)
还没有显示text3D中的pos(2,-5,0)。