[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trivial problem without trivial solution: Plotting points...



On Mon, 24 Apr 2006, Paulo J. Matos wrote:

> I have a file with dozens of points in the format:
> 2.4 2.5
> 1.2 1.4
> 1.5 2.6
> ...
>
> What's the best way to plot this under epix?
>
Dear Paulo,

I noticed your post after archiving the list. Late April was an extremely
busy time, and I must have filed your post without replying. My apologies!

In case you're still interesting in using epix for this task, here's the
general idea:

// expect plotdata.dat to contain 2 columns
plot("plotdata.dat", BOX, 2);


For more elaborate handling, e.g., if you have lots of columns and you
want to perform some statistical calculations on two of them:

// create an empty std::vector of vectors of doubles,
// suitable for a file of 5 columns
FILEDATA data(5);
read("mydata", data);
regression(data, 3, 4); // plot the regression line for columns 3, 4

The manual contains more details (toward the end of section 2).

Best,
Andy

Andrew D. Hwang			ahwang@mathcs.holycross.edu
Department of Math and CS	http://math.holycross.edu/~ahwang
College of the Holy Cross	(508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395	(508) 793-3530 (fax)