Re: 2D histogram of x,y values

• To: mathgroup at smc.vnet.net
• Subject: [mg14271] Re: 2D histogram of x,y values
• From: Lars Hohmuth <larsh>
• Date: Mon, 12 Oct 1998 13:51:51 -0400
• Organization: Wolfram Research, Inc.
• Sender: owner-wri-mathgroup at wolfram.com

```> Subject:
>              2D histogram of x,y values
>         Date:
>              7 Oct 1998 03:45:26 -0400
>        From:
To: mathgroup at smc.vnet.net
>              "Jurgen F. Doreleijers"
>  Organization:
>              NMR spectroscopy; Utrecht University; The Netherlands
>  Newsgroups:
>              comp.soft-sys.math.mathematica
>
>
>
>
> Hi,
>
> How can I make a 2D histogram of a list of x,y values? I would like to
> make a contour plot with the results.
>
>
> --
>     Drs. Jurgen F. Doreleijers
>     NMR spectroscopy, Utrecht University,  The Netherlands
>     mailto:jurgen at nmr.chem.uu.nl
>     http://www.nmr.chem.uu.nl/~jurgen
>
I am not exactly sure what you are looking for, so here is my best
guess.
If you have a set of {x,y} data and you want to count the how often the
{x,y} values fall into a certain range, you can use BinCounts in
Statistics`DataManipulation`

In[1]:=
<<Statistics`DataManipulation`
In[2]:=
listdata = N[Table[{i,i},{i,0,3}]];
In[3]:=
BinCounts[listdata,{0,3,1},{0,3,1}]
Out[3]=
{{1,0,0},{0,1,0},{0,0,1}}
In[4]:=
ListDensityPlot[%] (*ListContourPlot doesn't make much sense for such a
small set*)

Hope this helps,

Lars Hohmuth
Wolfram Research, Inc.

```

• Prev by Date: Re: Mouse is always a hand with Linux.
• Next by Date: Re: PROBLEM ENTERING 2D USING CTRL
• Previous by thread: Re: How: {{a,b},{1,2,3}} --> {{a,1},{b,2},{a,3}} ?
• Next by thread: 2D histogram of x,y values