rgl
rgl copied to clipboard
RGL plot3d() hangs in Jupyter Notebook, kills kernel
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")
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.
I have the same issue with jupyterlab
Does options(rgl.useNULL = TRUE)
work for you?
I'm going to assume this was fixed by #330 .