I have a data.frame named as z
, which has 4 millions data points to make scatter3d
plot by using plot_ly
as follows.
p <- plot_ly(z, x = ~Lon, y = ~Lat, z = ~z,
mode = 'markers',
marker = list(color = "black",size = 2, opacity =0.05),
type = 'scatter3d', source = 'scatter')
htmlwidgets::saveWidget(as_widget(p), "scatter3d_plotly.html") # save as html
Then, I came across an error, saying
pandoc.exe: Out of memory Error: pandoc document conversion failed with error 251
Because I assumed that this was a problem with memory allocation, I tested if downsampling can help to make a tentative plot as follows;
z_ds <- sample_frac(tbl = z, size = 0.01) # downsampled into 1%
Now, this works, which made sure that this is a problem of memory.
However, downsampling is not appropriate in my research purpose, and what I need is plotting all the 4 million data points in one figure.
In summary,
- I want a scatter3d plot with all 4 millions data point
- I do not really need completely "interactive" 3D plot if this makes difficult to deal with huge data point
- But, hopefully, I want to keep the "3D rotating feature" in the html format by drag.
- It does not have to use Plotly if there is alternative.
Would you please give me any suggestion about this?