rgl icon indicating copy to clipboard operation
rgl copied to clipboard

RGL plot3d() hangs in Jupyter Notebook, kills kernel

Open karimhalaseh opened this issue 4 years ago • 3 comments

I have been able to get an rgl plot working perfectly in RStudio. However, in Jupyter Notebook with an IR kernel, running the same code initially creates the plot, but the device window immediately stops responding, and the Jupyter Notebook kernel is killed. I couldn't find any reference to this issue; is it not possible to run the interactive plot in Jupyter? I have attached the relevant code, and a screenshot of the output.

library(rgl)
open3d()
plot3d(location_df_trunc$Dig.Point.X, location_df_trunc$Dig.Point.Y, location_df_trunc$Dig.Point.Z, 
       col = col.table[col.ind], xlab = "X", ylab = "Y", zlab = "Z")

image

karimhalaseh avatar Feb 12 '21 23:02 karimhalaseh

I've never tried Jupyter, so I don't know what the issue would be. You should be able to run rgl with the options(rgl.useNULL = TRUE) option to avoid trying to open the window. Most browsers can still do the display, including the one built in to RStudio. I don't know if Jupyter has anything similar.

dmurdoch avatar Feb 13 '21 22:02 dmurdoch

I have the same issue with jupyterlab

kaiwangyu avatar Jan 03 '22 17:01 kaiwangyu

Does options(rgl.useNULL = TRUE) work for you?

dmurdoch avatar Jan 03 '22 17:01 dmurdoch

I'm going to assume this was fixed by #330 .

dmurdoch avatar Mar 11 '23 17:03 dmurdoch