test2 <- ranHiveData(nx = 2)
test3 <- ranHiveData(nx = 3)
test4 <- ranHiveData(nx = 4, type = "3D")
#
# plot one with defaults:
plotHive(test3)
#
# Add axis labels & options to nx = 3 example. Note that rot is not part of gpar
require("grid")
plotHive(test3, ch = 5, labs = c("axis 1", "axis 2", "axis 3"),
lab.pos = c(10, 15, 15), lab.gpar = gpar(col = "orange", fontsize = 14),
rot = c(0, 30, -30))
#
# Now the nx = 2 case.
# Note that gpar contains parameters that apply to both the
# axis labels and arrow. A 6th value in arrow offsets the arrow vertically:
plotHive(test2, ch = 5, labs = c("axis 1", "axis 2"), rot = c(-90, 90),
lab.pos = c(20, 20), lab.gpar = gpar(col = "pink", fontsize = 14, lwd = 2),
arrow = c("radius units", 0, 20, 60, 25, 40))
# The following must be run interactively:
plot3dHive(test4)
Run the code above in your browser using DataLab