|
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'));
|