[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ePiX-users] Histograms, II
From: |
Andrew D. Hwang |
Subject: |
[ePiX-users] Histograms, II |
Date: |
Wed, 3 Jan 2007 21:44:08 -0500 (EST) |
Some preliminary (and not yet extensively tested) data plotting code is
available here:
http://mathcs.holycross.edu/~ahwang/epix/dataplot.tar.bz2
To use it, unpack it into the epix source directory and rebuild. (Maybe
install in ${HOME}/tmp for now. :)
There are data_file and data_bins classes. The data_bins class is pretty
much as outlined in yesterday's post. Here are typical snippets, assuming
mydat.txt is a data file containing enough columns:
data_file file0("mydat.txt"); // counts # of entries in first row
data_file file1(Cos, 0, M_PI, 60); // create "file" with one column
data_file file2(Cos, Sin, 0, M_PI, 60); // or two (up to three)
file1.write("trig.dat"); // export file1 to disk file trig.dat
file2.plot(BBOX); // scatter plot
file2.plot(PATH); // connect the dots
file0.plot(DDOT, log_lin); // semi-log plot of first two columns of file0
file0.plot(DDOT, log_lin, 2, 5); // semi-log plot of columns 2 and 5
double mean(file2.avg(2)); // arithmetic mean of column 2
file0.regression(2,3); // regression line for columns 2 and 3
data_bins H(-1, 1, 20); // [-1,1] divided into 20 equal subintervals
H.read(file1.column(1)); // sort and count first column of file1
H.read(file0.column(4), Cos); // append cosines of 4th column of file0
H.histogram(); // histogram; box height is population of bin
H.plot(); // smoothed histogram curve, not yet implemented
There are a few other features; please see the header file for full
details. The manual will be updated within a few days (not until features
stabilize... :) Log axis labels and (semi-)log coordinate grids are coming
soon.
The old data plotting code emits "deprecated" warnings if its called. I'll
probably add a couple of global (non-class) plot/histogram functions, but
the call syntax will differ slightly from the old versions (the number of
columns in the data file won't be required).
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, II,
Andrew D. Hwang <=