问题
I've installed the newest version of the rgl package by means of advice from the link below: How do I install the latest version of rgl? Then i tried to reproduce the code example of the answer from the post: Adding a legend to an rgl 3d plot Everything is working Ok except the command:
legend3d("topright", legend = paste('Type', c('A', 'B', 'C')), pch = 16, col = rainbow(3), cex=1, inset=c(0.02))
After executing the above command i have the warning message and no legend on the 3dplot in fact:
Warning messages:
1: In rgl.material(color = color, back = back, ...) :
RGL: Pixmap load: file format unsupported
2: In rgl.material(color = color, back = back, ...) :
RGL: Pixmap load: failed
How i can fix it? Thank you in advance.
回答1:
From the comments, it appears you don't have zlib in a place where R (or the rgl configure script) can see it. The location for it is currently given in the LOCAL_SOFT variable in R_HOME/etc/<ARCH>/Makeconf.
What you put there depends on which R version you're using. For 3.2.x or 3.3.x, I believe you can get suitable contents from https://cloud.r-project.org/bin/windows/extsoft/.
来源:https://stackoverflow.com/questions/37823863/doesnt-work-legend3d-function-in-the-newest-version-of-the-rgl-package