Message Boards Message Boards

1
|
8754 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Help needed to plot list of 10 million points

Posted 10 years ago

I am working on large dataset of size 10*10^6 and would like to visualize data. But it takes lot of time to plot. Any suggestions to plot fast without loss of data is appreciated. I also want to save the plot in pdf of optimal size and can be easily viewed.

For example:

x = RandomReal[{0, 2}, {10000000}];
y = RandomReal[{0, 100}, {10000000}];
ListLinePlot[{x, y}\[Transpose], PlotRange -> All] 

Thank You.

POSTED BY: Veena K
3 Replies

Mathematica creates vector graphics instead of raster graphics. Usually this is a good thing. But rending 10*10^6 data points in a vector graphic is a bit much. It's not that big of a deal usually when making a raster graphic.

Fortunately, you rarely - if ever - actually want to plot that many points. For the most part, you'll want to make a Histogram or a DensityPlot of some kind. Very often people plot many points instead of making a DensityPlot as a kind of stand in for a DensityPlot.

If rendering is actually the problem, you might want to work with Images instead of Graphics. You could implement a scatter plot for example fairly easily as an Image or an array using ArrayPlot.

POSTED BY: Sean Clarke
Posted 10 years ago

You might want to try hexagon binning. For some examples see http://cran.r-project.org/web/packages/hexbin/vignettes/hexagon_binning.pdf. While I'm unaware that Mathematica has an existing function for this, it would not be too difficult to write.

enter image description here

POSTED BY: Jim Baldwin
Posted 10 years ago

Tips for writing faster code

I also want to save the plot in pdf of optimal size and can be easily viewed.

Look at the documentation on PlotRange[].

POSTED BY: Gary Palmer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract