Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: plotYY - the most annoying command in the world
Replies: 15   Last Post: Feb 24, 2010 3:48 PM

 Messages: [ Previous | Next ]
 Paul Posts: 8 Registered: 2/14/10
Re: plotYY - the most annoying command in the world
Posted: Feb 14, 2010 6:00 PM

This is my latest attempt. The series are plotted with common dates and the limits work for the x-axis. However, if I try and specify the Xticks or use datetick is goes all screwy?

[ax,h1,h2] = plotyy(datenum(X(:,1)),X(:,2),datenum(X(:,1)),X(:,3));
title('Excess Holding Period Returns (5 Year Matury Zero) plotted alongside uncertainty on Real GDP')
grid on
grid minor
xlabel('Date','Color','k');
set(ax,'YColor','k','Box','on');
set(h1,'color','r','LineWidth',1.0)
set(h2,'color','b','LineWidth',1.0)

set(get(ax(1),'Ylabel'),'String','HPRX', 'color','r')
set(ax(1),'XLim',[datenum(1980, 07, 01) datenum(2009, 07, 01)])
set(ax(1),'YLim',[-0.2 +0.2])
set(get(ax(2),'Ylabel'),'String','DiB', 'color','b')
set(ax(2),'XLim',[datenum(1980, 07, 01) datenum(2009, 07, 01)])
set(ax(2),'YLim',[0 1.0])

Date Subject Author
2/14/10 Paul
2/14/10 dpb
2/14/10 Paul
2/15/10 dpb
2/15/10 Paul Mennen
2/15/10 Steven Lord
2/16/10 Paul
2/16/10 dpb
2/24/10 Dave
2/24/10 Steven Lord
2/24/10 Dave
2/24/10 dpb
2/16/10 dpb
2/16/10 Paul
2/16/10 dpb
2/16/10 dpb