[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ePiX-users] Histograms
From: |
Andrew D. Hwang |
Subject: |
[ePiX-users] Histograms |
Date: |
Tue, 2 Jan 2007 21:46:23 -0500 (EST) |
Hi all,
Marcus' email got me thinking about more featureful data plotting for
ePiX. Since I rarely plot data myself, I'm asking for user-level feature
requests and other suggestions or ideas.
My current line of thought has a "data_bin" class, which is created from
a minimum and maximum value, an optional number of bins (1 by default),
and perhaps a function that specifies bin widths in some convenient way.
For example,
data_bin(0, 10); // the interval [0,10]
data_bin(0, 10, 5); // [0,2], [2,4], ..., [8,10]
data_bin(1, 8, 3, geom); // [1,2], [2,4], [4,8]; geom(x) = pow(2, x)
Interval divisions can be added manually, e.g.
data_bin B(0, 10);
B.cut(3).cut(7); // B = [0,3], [3,7], [7,10]
B.cut(20); // out of range, no effect
Data can be read in from a vector of doubles or from a file. Once data has
been read in, no further interval subdivision is permitted.
B.read("myfile.dat", 2); // read in column 2
B.cut(5.5); // no effect
Draw a histogram with specified vertical scale or area:
B.histogram(); // defaults to "area = number of data points"
B.histogram(3); // triple box heights or total area 3...?
B.histogram(1/B.pop()); // unit-area histogram; B.pop() = population
B.normalize(); // now histograms will have unit area by default
Are there other features that would be useful? Does the syntax above seem
natural and easy to use? Are there common or standard ways of dividing an
interval into bins other than "equal length", and if so, what would be a
convenient mathematical description? Would it be useful to apply a user-
specified function to data as it's read in?
Thanks in advance for your input.
--Andy
Andrew D. Hwang address@hidden
Department of Math and CS http://mathcs.holycross.edu/~ahwang
College of the Holy Cross (508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395 (508) 793-3530 (fax)
- [ePiX-users] Histograms,
Andrew D. Hwang <=