help-octave
[Top][All Lists]
Advanced

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

Re: Octave plot on time/date x-axis


From: djacobson
Subject: Re: Octave plot on time/date x-axis
Date: Mon, 15 Sep 2008 14:30:57 -0700 (PDT)

I think Octave no longer allows to directly access gnuplot, so these
commands won't work. I don't know if there is some simple way to have
dates as tick labels, but you can always set tick labels manually,
like this:

data = [2 3 5 3.5 6];
datalabels = {'10/3/2008','10/4/2008','10/5/2008','10/6/2008','10/7/2008'};
% cell array
plot(data)
set(gca(),'xticklabels',datalabels)

Depending on your data, you could probably use something like
datestr() to fill cell array with respective dates as strings. Setting
graphic properties with get() and set() functions is documented in
Octave manual (section about advanced plotting), and since Octave
developers try to keep things compatible with MATLAB, I've found
reference on Mathworks site also useful.

Hope this helped
Ivan Sutoris
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


Ivan, 
I tried your example and i have looked at the gca/set documentation. When i
run your code (using 'xticklabel' instead of 'xticklabels' i still only get
the plot with the indicies 1,2,3,4,5 along the x-axis. Could there be
something missing from my installation or is there a package i need to load?
thanks, dan.
-- 
View this message in context: 
http://www.nabble.com/Octave-plot-on-time-date-x-axis-tp19496643p19501574.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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