2

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.

Community
  • 1
  • 1
Denis
  • 315
  • 4
  • 11
  • You don't have PNG support in your build. You don't give any hint as to why... – user2554330 Jun 15 '16 at 00:33
  • Do you suggest my installation was incorrect? How i can know it for sure? Have i reinstall the package? Thanks. – Denis Jun 15 '16 at 08:51
  • One possible reason i have not `zlib` on my windows mashine. During the `rgl` compilation process i caught the error message `checking for zlib...no libpng requires zlib, so not installed. freetype requires zlib, so not installed.` Unfortunately, i can not figure out how to install `zlib' for the windows (because i'm not an advanced windows user). Could you advice me please? – Denis Jun 15 '16 at 22:45

1 Answers1

2

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/.

user2554330
  • 37,248
  • 4
  • 43
  • 90