extensive scatter plot

J

Johannes Korn

Hi,

I would like to produce a scatter plot with roughly 200 mio points.
Because the points are so numerous I rather need a point density plot.

I use numpy. Right now I loop over the individual data points and make a
where query on a meshgrid.

ind = where((x_grid == x_points) & (y_grid == y_points) )
counter_grid[ind] += 1

This is really slow. I'm sure there's a better solution already out there.

Kind regards!
 
R

Robert Kern

Hi,

I would like to produce a scatter plot with roughly 200 mio points.
Because the points are so numerous I rather need a point density plot.

I use numpy. Right now I loop over the individual data points and make a
where query on a meshgrid.

ind = where((x_grid == x_points)& (y_grid == y_points) )
counter_grid[ind] += 1

This is really slow. I'm sure there's a better solution already out there.

Kind regards!


You will want to ask numpy questions on the numpy mailing list:

http://www.scipy.org/Mailing_Lists

If you are using a particular plotting package like matplotlib, you will want to
ask your plotting questions on their mailing lists. E.g.

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

If you are doing your own plotting, you will want to use the numpy.histogram2d()
function to make a 2D histogram that can be plotted using a colormapped image.
If you are using matplotlib, try matplotlib.pyplot.hexbin().

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hexbin

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top