help-octave
[Top][All Lists]
Advanced

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

How Do I Convert Dates In A Matrix For Plotting?


From: Perfect Tommy
Subject: How Do I Convert Dates In A Matrix For Plotting?
Date: Wed, 2 Jun 2010 12:14:11 -0700 (PDT)

I am using Octave 3.2.3 and Gnuplot 4.2 patchlevel 6.  My OS is Ubuntu 10.04
with kernel 2.6.32-22-generic.

I have data stored as a matrix.  The matrix is N rows by 7 columns.  Here is
a truncated example:

data = [1274680800,99.16,99.20,99.16,99.20,000,99.20;
1274076000,104.97,104.97,98.97,100.46,000,100.46;
1273471200,106.99,108.15,104.84,104.84,000,104.84;
1272866400,110.86,110.86,102.48,102.48,000,102.48];

The data in column 1 is date data (the day the data was taken).  Therefore,
if I do the following command, I can get the dates back in a human readable
format:

strftime("%m-%d-%Y", localtime(data(1,1)))
ans = 05-24-2010

The format of "data" was a design decision because I wrote a filter program
to get my data into this format.  Since this 
seems to be a common problem (associating date/timestamp with data), what is
the Octave best practice to do this?  I've 
searched but haven't found a discussion or example.  I can change my filter
to do the easiest/best thing.

I would like to plot some data versus the date using a human readable date
format.  With the latest version of Octave, how
do I communicate with gnuplot to do the following (gnuplot) commands?

set xdata time
set timefmt "%m-%d-%Y"

TIA

-----
Tom Haas
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/How-Do-I-Convert-Dates-In-A-Matrix-For-Plotting-tp2240660p2240660.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]