
2D Histogram

Marti
I have a problem to create 2D histogram. I have two data sets: ISIs in ms (0-500 ms, 250 bin, 250 ms binsize; Vm -60- -45mV, 250 bin, 0.1mV binsize) I've tried the commands below:
•make/n=(250,250) myHist
•setscale x,0,500,myHist
•setscale y,-60,-45, myHist
JointHistogram(data1,data2,myHist) or Function JointHistogram(data1,data2,myHist)
but I have an error message. Can anyone help?
Thanks,
Having done that, I was able to successfully execute these commands:
June 11, 2012 at 05:56 pm - Permalink
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
June 12, 2012 at 03:14 am - Permalink
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.
June 12, 2012 at 01:05 pm - Permalink
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,
June 13, 2012 at 02:55 am - Permalink
I managed to create the surface plot as well. Thanks!!!!
Marti
A.G.
WaveMetrics, Inc.[/quote]
June 13, 2012 at 03:49 am - Permalink
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:
June 13, 2012 at 04:36 am - Permalink