如何将图标的上标或下标添加到3D图中?
我尝试使用bquote
,但它没有用。谷歌搜索也没有带来太多关于此事。
清除代码:
library(plotly)
set.seed(123)
n <- 100
theta <- runif(n, 0, 2*pi)
u <- runif(n, -1, 1)
base<-'B1'
compare<-'A1'
plot (1, 1, main = bquote('Annual mean' ~CO[2] ~'Flux Difference: \n' ~.(compare)~ 'minus'~.(base)))
p <- plot_ly(x = ~sqrt(1 - u^2) * cos(theta), y = ~sqrt(1 - u^2) * sin(theta), z = ~u) %>%
layout(
title = "Layout options in a 3d scatter plot",
scene = list(
xaxis = list(title = bquote('Annual mean' ~CO[2] ~'Flux Difference: \n' ~.(compare)~ 'minus'~.(base))),
yaxis = list(title = "Sin"),
zaxis = list(title = "Z")
))
p
感谢您的时间!