Good Day All,
I want to add text floating in my wireframe plot and I am rather confused. I can certainly add the text as a title (e.g. main=”Hello World”) but I would rather not have my particular text in the title
Here is a sample wireframe:
library(lattice)
#set up some simplified data
x <- seq(-.8, .8, .1)
y <- seq(-.8, .8, .1)
myGrid <- data.frame(expand.grid(x,y))
colnames(myGrid) <- c("x","y")
myGrid$z <- myGrid$x + myGrid$y
wireframe(
myGrid$z ~ myGrid$x * myGrid$y,
xlab="X", ylab="Y", zlab="Z",
scales = list(z.ticks=5, arrows=FALSE, col="black", font=3, tck=1)
)
If I wanted to add “Hello World” in this plot floating somewhere how would I do that ?
Override the panel function and add text with
grid.text.