1

I need help to finish some hist3D() plots using R package plot3D.

The problem is that I don't know how to include superscripts and subscripts letters in the axis labels of this kind of plots. I've tried with other codes posted in this side, nevertheless they don't work with hist3D() plots.

I have this example:

library(plot3d)

VV <- volcano[seq(1, 87, 15), seq(1, 61, 15)]

hist3D(z = VV, scale = F, expand = 0.02, border = "black", colkey = F, xlab=paste0("\n\n", "NH4 (mg L-1)"),
ylab = paste0("\n\n","Irradiance (*mu mol m2 s-1)"),
zlab = paste0("\n\n","Concentration (g L-1)"))

In the X label, I need to convert the "4" from "NH4" into subscript and the "-1" from "mg L-1" into superscript. The same with the Y and Z labels.

If someone knows how to solve this I will appreciate it a lot.

Werner Hertzog
  • 2,002
  • 3
  • 24
  • 36
  • [I don't know that you can](https://stackoverflow.com/questions/20563516/how-to-plot-a-greek-letter-on-the-label-with-hist3d?rq=1). In `ggplot`, elements that call `plotmath` or `bquote` interpret expressions. `Hist3D` uses `persp` which specifies that `*lab` accept character strings only, expressions are not accepted. – Anonymous coward Oct 26 '18 at 20:21
  • 1
    Possible duplicate of [how to plot a greek letter on the label with hist3D?](https://stackoverflow.com/questions/20563516/how-to-plot-a-greek-letter-on-the-label-with-hist3d) – Anonymous coward Oct 26 '18 at 20:22
  • Thanks to you both, I've read more about this and you are right, expressions are not accepted for hist3D plots. The other question help me a little bit, Text3D function is not what I was expecting, but with a little bit of patience it will help me. – Eloy Montero Oct 26 '18 at 21:24

0 Answers0