Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!x41g2000hsb.googlegroups.com!not-for-mail
From: hrh1818 <hrhan@att.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Printing Plots in PDF format
Date: Fri, 25 Jul 2008 17:46:21 -0700 (PDT)
Organization: http://groups.google.com
Lines: 80
Message-ID: <0d0d7a41-78fa-4d71-b8f5-0f6c0ecdef04@x41g2000hsb.googlegroups.com>
References: <g6d752$3oa$1@fred.mathworks.com> <13efc0b1-46de-476e-a2fe-d132cd64d527@d45g2000hsc.googlegroups.com> 
NNTP-Posting-Host: 75.27.49.136
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1217033181 12573 127.0.0.1 (26 Jul 2008 00:46:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 26 Jul 2008 00:46:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: x41g2000hsb.googlegroups.com; posting-host=75.27.49.136; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) 
Xref: news.mathworks.com comp.soft-sys.matlab:481920



On Jul 25, 2:58 pm, "Naveen " <nku...@bloomberg.net> wrote:
> Howard, thanks for your reply. But you didnot answer my
> question, there is got to be a simpler method which only
> deals with Matlab code. Appreciate if you can help with a
> straight forward solution with the code.
> Best regards,
>
> hrh1818 <hr...@att.net> wrote in message <13efc0b1-46de-
>
> 476e-a2fe-d132cd64d...@d45g2000hsc.googlegroups.com>...
>
> > On Jul 25, 1:48 pm, "Naveen " <nku...@bloomberg.net>
> wrote:
> > > Hi,
> > > Iam trying to create a bunch of plots, and print them
> to
> > > pdf file. I am saving all my plots in figs() and if i
> > > print them one by one into PDF file it works. But i
> like
> > > to append them all together into one PDF file. I am
> unable
> > > to do this. Any help is appreciated very much. Thanks
> in
> > > advance. Best, Naveen

I know I didn't answer your original question.  That is why I labeled
my solution as an alternate approach.  Sometimes the easiest approach
to solving a problem is to try a different approach.   My only other
suggestion is after you write your first image to a file is the next
time time you need to write data you use fopen to open the file in
append mode.  It looks like your problem is caused by Matlab is over
writing your old data with new data.   If that don't work there is
always the brute force method.  Make 10 PDF files with a figure in
file.  Then create an M file that reads each file and writes the data
to a eleventh file that was open in the append mode.

No guarantees I have not tried either of these these last approaches
before making suggestions.  I have used a desktop publishing program
in the past to combine PDF files into one file.

Howard


>
> > > % Print each of the 10 plots in a separate PDF
> document.
>
> > > print(figs(1),'-dpdf','-r600','-painters','test1.pdf')
> > > print(figs(2),'-dpdf','-r600','-painters','test2.pdf')
> > > print(figs(3),'-dpdf','-r600','-painters','test3.pdf')
> > > print(figs(4),'-dpdf','-r600','-painters','test4.pdf')
> > > print(figs(5),'-dpdf','-r600','-painters','test5.pdf')
> > > print(figs(6),'-dpdf','-r600','-painters','test6.pdf')
> > > print(figs(7),'-dpdf','-r600','-painters','test7.pdf')
> > > print(figs(8),'-dpdf','-r600','-painters','test8.pdf')
> > > print(figs(9),'-dpdf','-r600','-painters','test9.pdf')
> > > print(figs(10),'-dpdf','-r600','-
>
> painters','test10.pdf')
>
>
>
> > > % Print all the 10 plots into one PDF document.
>
> > > print(figs(1),'-dpdf','-r600','-painters','test.pdf');
> > > for i=2:length(figs)
> > >         print(figs(i),'-append','-dpdf','-r600','-
> > > painters','test.pdf');
> > > end
>
> > An alternate approach is to use a desk top publishing
> program to
> > combine your 10 individual documents into one document.
> Scribus is a
> > free desktop publishing program that can handle this
> task.   See:
> >http://www.scribus.net/
>
> > Howard