2D Histogram
| Marti | June 7, 2012 - 01:06 | ||
|---|---|---|---|
|
Hi, •make/n=(250,250) myHist but I have an error message. Can anyone help? |
|||
| Marti | June 7, 2012 - 01:06 | ||
|---|---|---|---|
|
Hi, •make/n=(250,250) myHist but I have an error message. Can anyone help? |
|||
Joined: 2007-06-21
Location: United States
You need to post the JointHistogram function from http://www.igorexchange.com/node/1373 into your procedure window.
Having done that, I was able to successfully execute these commands:
Joined: 2012-04-13
Location: United Kingdom
Hi,
Yes, thank you very much. Meantime I have found my mistake in the function as well. It works fine in my case too and I got a nice contour plot. I have an other question. How can I normalise the matrix of the results of the 2D Histogram?
Also if I would like to represent the 'density' or the number of dots in each bins and I apply the contour plot how can I set values for the z axe and represent in 3D graph?
Thank you very much for your help,
Marti
Joined: 2007-06-29
Location: United States
You have not defined what you mean by normalization. If you only want the output to sum to 1 then execute:
Variable sss=sum(matrix2d)
Duplicate/O matrix2d,normalized2d // never modify the original
normalized2d/=sss
You are not telling us what kind of a 3D graph you want to plot: do you want to plot a surface, a scatter or maybe some kind of a 3D bar chart?
A.G.
WaveMetrics, Inc.
Joined: 2012-04-13
Location: United Kingdom
Hi A.G.,
Thank you very much for your help, the normalization works fine.
I'm sorry if I wasn't enough precise, I meant the surface plot as a 3D graph. But you are right the 3D bar chart can be interesting as well.
Thanks,
Joined: 2012-04-13
Location: United Kingdom
Hi A.G.
I managed to create the surface plot as well. Thanks!!!!
Marti
A.G.
WaveMetrics, Inc.[/quote]
Joined: 2007-08-16
Location: United States
Marti,
Typically histograms are plotted in a bar-chart mode (although that is partly a matter of taste). AG was perhaps too modest to mention his Gizmo3DBarChart.ipf that comes with Igor, in the Wavemetrics Procedures:Gizmo Procedures folder.
If you don't care for the spacing between bars, then a surface plot will do. Be aware however that standard surface plots interpolate over the grid. If you want flat-topped bins of the histogram in a surface mode, AG had sent me the following procedure for converting to a parametric surface wave: