Thread Subject: plotting to multi-page pdf

Subject: plotting to multi-page pdf

From: Timothy Hilton

Date: 26 Jan, 2012 21:37:10

Message: 1 of 3

I need to save a series of plots to a multi-page pdf. I am using export-fig to save png files (I am plotting a year's worth of hourly points for a number of fields, so vector graphics get big fast and bitmap images are fine in this instance).

convert *.png foo.pdf works from a cygwin prompt, but within matlab I get:
>> system('convert *.png foo.pdf')
Invalid Parameter - foo.pdf
ans =
     4

Any suggestions? Is there a better way to create a multi-page PDF document containing a series of bitmap plots? I would love to stay within matlab if possible.

Thanks!
Tim

Subject: plotting to multi-page pdf

From: Timothy Hilton

Date: 26 Jan, 2012 22:01:09

Message: 2 of 3

within matlab I get:
> >> system('convert *.png foo.pdf')
> Invalid Parameter - foo.pdf
> ans =
> 4

OK, the system call sends the command to a DOS prompt; I guess that's not surprising on a windows system. So I guess as stated this is more of an ImageMagick/DOS command prompt question than a matlab question.

My underlying problem is that I want to create a multipage PDF, preferably in raster format, from within matlab. The export_fig / ImageMagick method is the best thing I've found on this newsgroup or the web. Has anyone had any success with this on a windows machine?

Thanks,
Tim

Subject: plotting to multi-page pdf

From: Doug Schwarz

Date: 27 Jan, 2012 19:21:36

Message: 3 of 3

On 1/26/2012 4:37 PM, Timothy Hilton wrote:
> I need to save a series of plots to a multi-page pdf. I am using
> export-fig to save png files (I am plotting a year's worth of hourly
> points for a number of fields, so vector graphics get big fast and
> bitmap images are fine in this instance).
>
> convert *.png foo.pdf works from a cygwin prompt, but within matlab I get:
>>> system('convert *.png foo.pdf')
> Invalid Parameter - foo.pdf ans =
> 4
>
> Any suggestions? Is there a better way to create a multi-page PDF
> document containing a series of bitmap plots? I would love to stay
> within matlab if possible.
>
> Thanks!
> Tim

Tim,

If you print to PS instead of PDF you can use the -append option with
print to build up a PS doc of many pages. Then use ps2pdf (download
from the FEX) to convert that into a PDF. It uses the version of
Ghostscript that comes with MATLAB so no additional software is needed.


--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
plotting Timothy Hilton 26 Jan, 2012 16:39:15
exporting figures Timothy Hilton 26 Jan, 2012 16:39:15
rssFeed for this Thread

Contact us at files@mathworks.com