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: Ivan Sutoris
Subject: Re: Octave plot on time/date x-axis
Date: Wed, 17 Sep 2008 09:44:53 +0200

> 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.
> --

It worked for me with JHandles graphics, and I thought I tried it also
with gnuplot, but apparently not, so sorry for misleading (and for the
typo). However, I played with it a little more (with gnuplot now :)
and I've found out that if you also specify xtick position manually,
the code should work (I'm not sure if that is a feature or bug):

data = [2 3 5 3.5 6];
datalabels = {'10/3/2008','10/4/2008','10/5/2008','10/6/2008','10/7/2008'};
plot(data)
set(gca(),'xtick',1:5) % set tick pos. manually
set(gca(),'xticklabel',datalabels)

Ivan Sutoris


reply via email to

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