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: Bill Denney
Subject: Re: Octave plot on time/date x-axis
Date: Mon, 15 Sep 2008 18:46:28 -0400
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Ivan Sutoris wrote:
>> I would like to plot a data set that has dates and time in the x-axis. I
>> have found the following code, but when I enter it i get a parse error:
>> syntax error.
>>
>>  __gnuplot_set xdata time
>>  __gnuplot_set timefmt "%d/%m"
>>  __gnuplot_set format x "%b %d"
>>     
>
> 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)
If you install the financial package, you can use the dateaxis command
which likely does what you're wanting to do.

Have a good day,

Bill


reply via email to

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