Re: Unstable DATETICK



On Apr 26, 6:45 pm, Rune Allnor <all...@xxxxxxxxxxxx> wrote:
On Apr 26, 7:03 am, TideMan <mul...@xxxxxxxxx> wrote:









On Apr 26, 3:45 pm, Rune Allnor <all...@xxxxxxxxxxxx> wrote:

Hi all.

I have this annoying problem with DATETICK (R2010a):
I have a script that does a query towards a database and
extracts some data. The data are then processed in a number
of ways, and plotted in one figure along the lines of

subplot(2,1,1)
plot(dates,dataA)
axis(Ax)
datetick('x')
grid on

subplot(2,1,2)
plot(dates,dataB)
axis(Ax)
datetick('x')
grid on

The whole point of the plotting is that the gridlines
in the two subplots align, so it is easy to see co-variation
between the two data sets.

The problem is that this whole thing is unstable.
I make this kind of plot for a few dozen data sets, and
for the most part this works as desired.

But every now and then it doesn't.

The data are collected over a c. 8-week period. Most of
the time the grid lines align with weeks, which is OK.
Every now and then *one* subplot flips out, and aligns the
gridlines with the 1st of every month. This happens when I
run the script. When I backtrace the script in the debugger,
everything works as desired.

Does anyone have ideas what to look for?

I can't post examples since the data are extracted from a
corporate database.

Rune

Yes, and that's why I always do this:
set(gca,...
   'XLim',[t1 t2])
datetick('x',12,'keeplimits')

That way, it cannot play funny buggers with me.

It can and it does, with me.

When I test your trick with the main axes in a figure window
(that is, subplot(1,1,1)) then things work as I want them to.

The problem is that I have these things in a subplot(6,2,1) window.
And there it breaks down. It also breaks down in subplot(6,2,3),
but not in subplot(6,2,5) - subplot(6,2,11) (axes at the right-
hand side are used for other stuff.) What's the difference
between these axes?

Now the problem becomes: How can I *force* datetick to set up
grid lines every 7 days over a 10'ish-week period? And not
automatically flip to one grid line at the first in each month?

Rune

Maybe subplot is the problem.
I never use subplot.
Instead I use:
axes('Position',[left bottom width height])
to position and size each panel.
This enables me to squash the plots up if I need to like this:
http://www.mulgor.co.nz/MarsPt/WeatherMaps12.html
.



Relevant Pages

  • Re: Unstable DATETICK
    ... run the script. ... corporate database. ... Maybe subplot is the problem. ...
    (comp.soft-sys.matlab)
  • Re: Unstable DATETICK
    ... the time the grid lines align with weeks, ... run the script. ... corporate database. ...
    (comp.soft-sys.matlab)
  • Re: How to fire an event
    ... There is no script code, I have a check box column and I loop thru the rows, ... manipulating the grid in script would cause a server event to be raised. ... The problem here is that I have no idea whether the grid will raise the ... void gd_UpdateRowBatch ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: The amplitude frequecy reponse of modulated LP filter
    ... why the amplitude frequency response of a  low pass filter reduced to ... subplot 211; ... Look up Heaviside Shifting theorem - frequency shifting via ...
    (comp.dsp)
  • Re: Unstable DATETICK
    ... I make this kind of plot for a few dozen data sets, ... run the script. ... One call to AXES for each panel? ...
    (comp.soft-sys.matlab)