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:
•setscale y,-60,-45, myHist
JointHistogram(data1,data2,myHist) or Function JointHistogram(data1,data2,myHist)
but I have an error message. Can anyone help?
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:
Make /O /N=1000 xData = 500 * p/1000
Make /O /N=1000 yData = -60 + (15*p/1000)
Make /O /N=(250,250) myHist
SetScale y,-60,-45, myHist
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,
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.
I managed to create the surface plot as well. Thanks!!!!
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:
// fill the x-values
// fill the y-values
// fill the z-values
Back to top