[Top][All Lists]

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

Re: Trying to Plot grid lines every 7 days

From: Tim Pierce
Subject: Re: Trying to Plot grid lines every 7 days
Date: Wed, 9 Aug 2017 17:00:54 +0100

Your Octave example reverts to 5-day gridlines, which is the issue, it has altered the x-ticks
now if you change those x-ticks it will stretch them out to fit 2- days like I said

I dont think its worth investigating much further for 'this' discussion as we have 2 solutions, and I like the  'keepticks' and 'keeplimits'

but it probably should be rasied as a bug for Octave.

One would expect the xticks to be unaffected

And Matlab just appears to be on crack in your example... unless Tues 1 is from the next month, which is only thing I can imagine, it is as though it has set the xticks to xlim (x limits of the plot asa matrix [min, max] )

On 9 August 2017 at 16:35, Nicholas Jankowski <address@hidden> wrote:
On Wed, Aug 9, 2017 at 11:05 AM, Tim Pierce <address@hidden> wrote:
> Yes, that must be it
> The datetick in octave does something quite unpredictable from the example I
> gave, where the sin wave wouldbe intact, but it wold stretch toonly the 20th
> day, instead of the 30th

Well, whether or not it's odd, matlab is also odd, and there does
appear to be some sort of output incompatibility.

Running through your initial example without the 'keep' options, I've
attached the graphs as they look just before and after the final line:

1  plot( 1:30, sin((1:30) .* (2 * pi / 30) ) )
2  grid on
3  set (gca, 'xtick', 1:7:30)
4  datetick ('x', 'ddd dd')

(note, matlab doesn't let you leave out the 'x', but octave does.
doesn't change octave's output)

So matlab is also changing both the limits and tick locations of the
plot, but it's doing so differently than octave. It appears that
neither the inline help or website documentation provide any insight
into how datetick selects tick and limit values.


reply via email to

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