3

我想用PC_1PC_3(下标)作为 x 轴和 z 轴的标签制作散点 3D 图。我通常会这样做,expression(PC[1])但它不起作用。我只是找不到解决问题的方法。

library(plot3D)

par(mar = c(4, 0, 3.2, 2))
scatter3D(pc$PC1, pc$PC2, pc$PC3, phi = phi, theta = 180,
      colvar = as.integer(sz$t)/60, clab = c("Zeit in", "Minuten"),
      col = ramp.col(c("deepskyblue", "blue", "darkorchid", "violetred", "red")),
      bty = "b2", type = "b", ticktype = "detailed",
      pch = 20, lwd = 2, cex.lab = 1.4, cex.axis = 1.4, cex = 1,
      colkey = FALSE, main = "",
      xlab = expression(PC[1]), ylab = "", zlab = expression(PC[3]),
      xlim = c(min(pc), max(pc)), ylim = c(min(pc), max(pc)), zlim = c(min(pc), max(pc))
)

它只显示PC[1]PC[3]作为轴标签。PC["1"]"PC"["1"]或任何其他组合也不起作用。

4

0 回答 0