Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Plotting in Matlab -- Help please..
Date: Wed, 23 Jul 2008 13:39:02 +0000 (UTC)
Organization: Santander Investment Securities Inc
Lines: 45
Message-ID: <g67c9m$lv6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216820342 22502 172.30.248.38 (23 Jul 2008 13:39:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 23 Jul 2008 13:39:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 753791
Xref: news.mathworks.com comp.soft-sys.matlab:481221



Hi, I am trying to plot a bunch of graphs in matlab 
(subplots actually) and then create a pdf file. My data 
file is in excel, first column - dates, and all other 
columns data series. So, i have to plot each of the data 
series columns against the dates column. I am trying to 
have 4 plots per figure. I am having 2 issues here.

1. I am able to generate the plots, but the x-axis dates 
scale is messed up. I am trying to show x-axis dates in 90 
day i-e 3 month time intervals of a 2 year rolling data 
series. The plots doesn't come out the way you would  
normally see in excel. It looks like the plot assumes the 
data series begins at the beginning of a specific month, 
for instance if the data series is from 7/22/06 to 
7/22/08, the it assumes that the series should start on 
7/1/06 (so leaves some blanks at the beginning in the 
plot) and makes some funky assumptions at the end of the 
series as well. So, net-net the dates are messed up on the 
x-axis. 

2. I am saving all the plots (4 each on one figure) using 
a figs() which has all the figures. 
 
    for i=1:length(figs)
       print(figs(i),'-append','-dpdf','-r600','-
painters','test.pdf');
    end

I like to print them into a PDF file. But it is not 
working. Only the final figure with 4 subplots is coming 
out in the PDF file. Some how the prior figures are all 
being overwritten. 

Sincerely appreciate your help.

Best,
Naveen

dates -- has the column of dates
    subplot(2,2,i);
    plot(dates(:,1),data(:,i));
    set(gca, 'XTickLabel', datestr(dates(1:60:length
(dates)),'mmm-yy'));