From: Steven Lord on

"Paul " <paulsastud(a)hotmaill.com> wrote in message
news:hl9phu$6oo$1(a)fred.mathworks.com...
> Hi,
> Hopefully someone can help me here because i'm lost for fixing this. I'm
> trying to plot two time series at shared x-values but with different
> scales on the y-axis. I extract both time series from a financial time
> series object since plotyy doesn't like this construct.
> My problem is that I can't get the dates on the x-axis to appear properly.
> I simply want to print a series of common dates and then set the Xlim.

*snip*

> datetick('x',10,'keepticks')

Call DATETICK twice, passing one of the handles to each axes (which you
obtained from the output of PLOTYY) into each call.

datetick(ax(1), 'x', 10, 'keepticks')
datetick(ax(2), 'x', 10, 'keepticks')

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: dpb on
Steven Lord wrote:
....

> Call DATETICK twice, passing one of the handles to each axes (which you
> obtained from the output of PLOTYY) into each call.
....

Seems to me as though plotyy ought to only have one set of x axes ticks
active. Is there (useful) reason to display both so that this is req'd
here?

--
From: Paul on
"Steven Lord" <slord(a)mathworks.com> wrote in message <hld8ce$o62$1(a)fred.mathworks.com>...
>
> "Paul " <paulsastud(a)hotmaill.com> wrote in message
> news:hl9phu$6oo$1(a)fred.mathworks.com...
> > Hi,
> > Hopefully someone can help me here because i'm lost for fixing this. I'm
> > trying to plot two time series at shared x-values but with different
> > scales on the y-axis. I extract both time series from a financial time
> > series object since plotyy doesn't like this construct.
> > My problem is that I can't get the dates on the x-axis to appear properly.
> > I simply want to print a series of common dates and then set the Xlim.
>
> *snip*
>
> > datetick('x',10,'keepticks')
>
> Call DATETICK twice, passing one of the handles to each axes (which you
> obtained from the output of PLOTYY) into each call.
>
> datetick(ax(1), 'x', 10, 'keepticks')
> datetick(ax(2), 'x', 10, 'keepticks')
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>


Dear Sirs, you are both gentlemen. Both methods work and also allow me to pass my own x_tick labels.

Thanks
Paul
From: Paul on
dpb <none(a)non.net> wrote in message <hlee13$41d$1(a)news.eternal-september.org>...
> Steven Lord wrote:
> ...
>
> > Call DATETICK twice, passing one of the handles to each axes (which you
> > obtained from the output of PLOTYY) into each call.
> ...
>
> Seems to me as though plotyy ought to only have one set of x axes ticks
> active. Is there (useful) reason to display both so that this is req'd
> here?
>
> --

If you are plotting against a common time series then no. However, I think the underlying functionality can handle different x-axis, if theoretically, you wanted to do this:

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f1-11215.html

Why you would ever actually want to do this - i'm not sure.
From: dpb on
Paul wrote:
....

> If you are plotting against a common time series then no. However, I
> think the underlying functionality can handle different x-axis, if
> theoretically, you wanted to do this:
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f1-11215.html
>
>
> Why you would ever actually want to do this - i'm not sure.

But plotyy apparently isn't smart enough[1] to do anything except
concatenate the two time series into a single range; it doesn't have
enough sense to use two separately drawn axes to show disparate ranges
which makes the second set simply redundant and requires such kludges as
resorted to here when customizing.

Should/could be improved...

[1] Or more precisely, at least a few simple-minded tests weren't able
to do so if it does have some embedded logic to do otherwise. I haven't
read the code extensively...

--