Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to plot all of huge data points in scatter3d of plot_ly?

$
0
0

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,

  1. I want a scatter3d plot with all 4 millions data point
  2. I do not really need completely "interactive" 3D plot if this makes difficult to deal with huge data point
  3. But, hopefully, I want to keep the "3D rotating feature" in the html format by drag.
  4. It does not have to use Plotly if there is alternative.

Would you please give me any suggestion about this?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>