Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Convert x-axis plot labels from epoch seconds to YYYY-MM-DD HH:mm:ss string?
Date: Wed, 7 Nov 2007 00:39:30 +0000 (UTC)
Organization: UCSD
Lines: 30
Message-ID: <fgr1g2$t5g$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1194395970 29872 172.30.248.35 (7 Nov 2007 00:39:30 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 Nov 2007 00:39:30 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1173592
Xref: news.mathworks.com comp.soft-sys.matlab:436343



Hi there,

I am plotting some data where the x co-ordinate is in epoch seconds (or unix 
time, seconds since 1970-01-01 00:00:00). I would like to convert *just* the 
x-axis labels to an equivalent time string. For example, if I have the x-axis 
labels (automatically created by Matlab):

1089865982
1089867030
1089868078
1089869126
1089870174
1089871222
1089872270


I would like these to display as:

2004-07-15 04:33:02
2004-07-15 04:50:30
2004-07-15 05:07:58
2004-07-15 05:25:26
2004-07-15 05:42:54
2004-07-15 06:00:22
2004-07-15 06:17:50

I have read about the graphics object properties like XTickLabel and XTick, 
but I cannot see documented anywhere how to format the tick labels.

Thanks in advance.