Thread Subject: Plotting in Matlab -- Help please..

Subject: Plotting in Matlab -- Help please..

From: Naveen

Date: 23 Jul, 2008 13:39:02

Message: 1 of 1

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


Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com