rmaia / pavo

tools for the analysis of color data in R
http://pavo.colrverse.com
GNU General Public License v2.0
68 stars 17 forks source link

tcsplot does not show plot in Linux #232

Closed aacocucci closed 3 years ago

aacocucci commented 3 years ago

Hi, I'm trying to plot a tetrahedron with tcsplot. I use the example given in the documentation. The scripts run ok, the data tables are there, no errors or warnings but the plot does not show up. I work with Ubuntu 18.04, pavo 2.7 and Rstudio 1.4.1717. I have also tried running the script in the R console outside Rstudio but the problem persists. In Windows the same script does show up as expected. Any suggestions what may be happening?

Bisaloo commented 3 years ago

Hi,

I can reproduce your issue but I have the same problem when I try to run example from rgl so I would say that it comes from rgl, not from pavo.

You can check with this example from ?rgl::plot3d:

library(rgl)
open3d()
x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x, y)
plot3d(x, y, z, col = rainbow(1000))
Bisaloo commented 3 years ago

When I load rgl, I get the following message:

This build of rgl does not include OpenGL functions. Use rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE)

And if I run options(rgl.printRglwidget = TRUE), the plot opens in my web browser. So it might be an intended breaking change from their end.

Bisaloo commented 3 years ago

Or simpler:

library(pavo)
data(sicalis)
vis.sicalis <- vismodel(sicalis, visual = "avg.uv")
tcs.sicalis <- colspace(vis.sicalis, space = "tcs")
tcsplot(tcs.sicalis, size = 0.005)
rgl::rglwidget()
Bisaloo commented 3 years ago

Closing this issue since it doesn't come from us and I offered a way around it. Feel free to reach out if you are more problems :wink: