3

I want to make a scatter 3D Plot with PC_1 and PC_3 (subscripts) as labels of the x- and z-axis. I would usually do it with expression(PC[1]) but it doesn't work. I just can't find a way to solve the problem.

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))
)

It just shows PC[1] and PC[3] as axis labels. PC["1"] and "PC"["1"] or any other combination also don't work.

Werner Hertzog
  • 2,002
  • 3
  • 24
  • 36
Zerg
  • 31
  • 1
  • That doesn't work. See a solution [here](https://community.rstudio.com/t/how-to-include-superscripts-and-subscripts-on-axis-from-hist3d-plots-plot3d-package/17064/2), with `text3d`. Good luck! – Stéphane Laurent Sep 07 '19 at 12:37
  • That doesn't work for me as I can't place a text outside of the plots "box". – Zerg Sep 07 '19 at 13:19

0 Answers0