Velocity Reviews > extensive scatter plot

extensive scatter plot

Johannes Korn
Guest
Posts: n/a

 11-24-2010
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[i]) & (y_grid == y_points[i]) )
counter_grid[ind] += 1

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

Kind regards!

Robert Kern
Guest
Posts: n/a

 11-24-2010
On 11/24/10 9:12 AM, Johannes Korn wrote:
> 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[i])& (y_grid == y_points[i]) )
> 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

https://lists.sourceforge.net/lists/...tplotlib-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/ap....pyplot.hexbin

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
an underlying truth."
-- Umberto Eco

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Derek Basch Python 9 11-03-2010 07:30 PM C Barrington-Leigh Python 1 09-12-2010 09:58 PM Walter Roberson Cisco 3 08-30-2006 09:10 PM Dr. Colombes Python 1 02-10-2005 08:49 PM antoine Java 1 01-20-2005 01:55 AM