help-octave
[Top][All Lists]
Advanced

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

[changeset]: Re: Octave plot on time/date x-axis


From: John W. Eaton
Subject: [changeset]: Re: Octave plot on time/date x-axis
Date: Wed, 17 Sep 2008 14:35:49 -0400

On 16-Sep-2008, David Bateman wrote:

| Bill Denney wrote:
| > David Bateman wrote:
| >   
| >> Bill Denney wrote:
| >>     
| >>> If you install the financial package, you can use the dateaxis command
| >>> which likely does what you're wanting to do.
| >>>       
| >> How does dateaxis differ from the dateticks function?  Taking a quick
| >> look at the matlab help pages, I can see that much of a difference in
| >> them. Perhaps we should migrate dateaxis to Octave as the dateticks
| >> command and make dateaxis depend on dateticks?
| >>     
| >
| > It differs in that I didn't know about it when I was implementing
| > dateaxis.  You're right that it's a good idea to migrate it to Octave
| > and have dateaxis be a call to datetick.  I probably won't be able to do
| > it soon, though because I'm moving in the next 1.5 weeks.
| >
| > Have a good day,
| >
| > Bill
| >
| >   
| How about something like the attached? Notice that for datetick we have 
| to calculate the tick positions ourselves manually as they should fall 
| of reasonable times. I've attempted to do this in this version, but it 
| probably needs some work.
| 
| With this changeset dateaxis can then be implemented as
| 
| function varargout = dateaxis (varargin);
|     [varargout{:}] = datetick (varargin{:});
| endfunction

It's not that simple.  It think you'll need to handle nargout == 0
separately, and also initiailize varargout = cell (1, nargout) for the
case of nargout > 0.

| In any case this was based heavily on your dateaxis code Bill.

After applying the patch, I see

  octave:11> demo datetick
  datetick example 1:
   yr = 1900:10:2000;
   pop = [76.094, 92.407, 106.461, 123.077 131.954, 151.868, 179.979, ...
          203.984, 227.225, 249.623, 282.224];
   plot (datenum (yr, 1, 1), pop);
   title ("US population (millions)");
   xlabel ("Year");
   datetick ("x", "YYYY");

  error: structure has no member `__colorbar__'
  error: evaluating argument list element number 1
  error: called from:
  error:   /home/jwe/src/octave/scripts/plot/__go_draw_figure__.m at line 44, 
column 1
  error:   /home/jwe/src/octave/scripts/plot/gnuplot_drawnow.m at line 68, 
column 5

What am I missing?

jwe


reply via email to

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