Histograms in Igor Pro
Histogram fills a destination wave whose scaling becomes the bin axis.
Function BuildHistogram(WAVE w)
WaveStats/Q w
Variable width = (V_max - V_min) / 50
Make/O/N=50/D hist
Histogram/B={V_min, width, 50}/Dest=hist w
Variable mode = DimOffset(hist, 0) + DimDelta(hist, 0) * V_maxloc
return mode
End
How it works
/B={start, width, count}sets the bins explicitly./Dest=names the output, which Igor scales for you.- The result is an ordinary wave, so everything else applies to it.
Keywords and builtins used here
DimDeltaDimOffsetEndFunctionHistogramMakeVariableWAVEWaveStatsreturn
The run, in numbers
- Lines
- 10
- Characters to type
- 229
- Tokens
- 61
- Three-star pace
- 80 tpm
At the three-star pace of 80 tokens a minute, this run takes about 46 seconds.
Step 2 of 3 in Measuring, step 6 of 16 in Waves & analysis.