Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Saving figures to a single location

Subject: Saving figures to a single location

From: Travis

Date: 28 Jan, 2010 22:53:04

Message: 1 of 10

I have 104 graphs that I would like to save to a common location so they can be viewed side by side. I tried subplots, but that didn't help as it created a lot of flat little graphs, even if I change the papersize. I would ideally like it in a 52x2 grid similar to subplot. Any help would be greatly appreciated.

Subject: Saving figures to a single location

From: Walter Roberson

Date: 28 Jan, 2010 22:59:28

Message: 2 of 10

Travis wrote:
> I have 104 graphs that I would like to save to a common location so they
> can be viewed side by side. I tried subplots, but that didn't help as
> it created a lot of flat little graphs, even if I change the papersize.
> I would ideally like it in a 52x2 grid similar to subplot. Any help
> would be greatly appreciated.

I'm confused about whether you are saving to one file per plot, one file per
pair of plots, one file total; or if you are trying to do this for printing on
a single page, or if you are trying to generate 52 pages with 2 plots each; or
if you are trying to construct a GUI that would allow this 52x2 array to be
scrolled ??

Subject: Saving figures to a single location

From: Travis

Date: 28 Jan, 2010 23:11:02

Message: 3 of 10

Walter Roberson <roberson@hushmail.com> wrote in message <hjt5ak$fql$1@canopus.cc.umanitoba.ca>...
> Travis wrote:
> > I have 104 graphs that I would like to save to a common location so they
> > can be viewed side by side. I tried subplots, but that didn't help as
> > it created a lot of flat little graphs, even if I change the papersize.
> > I would ideally like it in a 52x2 grid similar to subplot. Any help
> > would be greatly appreciated.
>
> I'm confused about whether you are saving to one file per plot, one file per
> pair of plots, one file total; or if you are trying to do this for printing on
> a single page, or if you are trying to generate 52 pages with 2 plots each; or
> if you are trying to construct a GUI that would allow this 52x2 array to be
> scrolled ??

1 file all plots. a jpg, or a .ai, hell even into a word document, just something where the graphs are usable.

Subject: Saving figures to a single location

From: Walter Roberson

Date: 28 Jan, 2010 23:22:06

Message: 4 of 10

Travis wrote:
> Walter Roberson <roberson@hushmail.com> wrote in message
> <hjt5ak$fql$1@canopus.cc.umanitoba.ca>...
>> Travis wrote:
>> > I have 104 graphs that I would like to save to a common location so
>> they > can be viewed side by side. I tried subplots, but that didn't
>> help as > it created a lot of flat little graphs, even if I change the
>> papersize. > I would ideally like it in a 52x2 grid similar to
>> subplot. Any help > would be greatly appreciated.

> 1 file all plots. a jpg, or a .ai, hell even into a word document, just
> something where the graphs are usable.

Draw one image at a time, screen capture it, write the data into the next
block of a matrix; at the end, imwrite() the matrix ?

Subject: Saving figures to a single location

From: Travis

Date: 29 Jan, 2010 00:52:06

Message: 5 of 10

Walter Roberson <roberson@hushmail.com> wrote in message <hjt6l2$hjc$1@canopus.cc.umanitoba.ca>...
> Travis wrote:
> > Walter Roberson <roberson@hushmail.com> wrote in message
> > <hjt5ak$fql$1@canopus.cc.umanitoba.ca>...
> >> Travis wrote:
> >> > I have 104 graphs that I would like to save to a common location so
> >> they > can be viewed side by side. I tried subplots, but that didn't
> >> help as > it created a lot of flat little graphs, even if I change the
> >> papersize. > I would ideally like it in a 52x2 grid similar to
> >> subplot. Any help > would be greatly appreciated.
>
> > 1 file all plots. a jpg, or a .ai, hell even into a word document, just
> > something where the graphs are usable.
>
> Draw one image at a time, screen capture it, write the data into the next
> block of a matrix; at the end, imwrite() the matrix ?

how do I screen capture in matlab? I know how with the print scrren button, but I would like it automated. I tried getframe, but it doesn't save an associated colormap with the image, so imwerite doesn't like it.

Subject: Saving figures to a single location

From: Yair Altman

Date: 29 Jan, 2010 07:03:05

Message: 6 of 10

> how do I screen capture in matlab? I know how with the print scrren button, but I would like it automated. I tried getframe, but it doesn't save an associated colormap with the image, so imwerite doesn't like it.

Use my ScreenCapture utility on the File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/24323-screencapture-get-a-screen-capture-of-a-figure-frame-or-component

Yair Altman
http://UndocumentedMatlab.com

Subject: Saving figures to a single location

From: Travis

Date: 1 Feb, 2010 21:24:24

Message: 7 of 10

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <hju179$mfk$1@fred.mathworks.com>...
> > how do I screen capture in matlab? I know how with the print scrren button, but I would like it automated. I tried getframe, but it doesn't save an associated colormap with the image, so imwerite doesn't like it.
>
> Use my ScreenCapture utility on the File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/24323-screencapture-get-a-screen-capture-of-a-figure-frame-or-component
>
> Yair Altman
> http://UndocumentedMatlab.com

screencapture works great, but I still cannot get multiple images to write a common file I am trying the following code...

for i = 1:5;
    imwrite(gf(i).picture,map,'Test.hdf','Compression','jpeg','WriteMode','append')
end

where gf is a structure where the screencaptures were saved. According to imwrite only the .hdf extension is able to append a file, but I would rather have a jpeg.

Subject: Saving figures to a single location

From: Walter Roberson

Date: 1 Feb, 2010 21:55:45

Message: 8 of 10

Travis wrote:

> screencapture works great, but I still cannot get multiple images to
> write a common file

Combine screencapture with my earlier suggestion of writing each image to the
appropriate block of a larger array, and then writing out the entire array as
an image in one step.

Subject: Saving figures to a single location

From: Travis

Date: 1 Feb, 2010 22:58:06

Message: 9 of 10

Walter Roberson <roberson@hushmail.com> wrote in message <hk7j3j$t93$1@canopus.cc.umanitoba.ca>...
> Travis wrote:
>
> > screencapture works great, but I still cannot get multiple images to
> > write a common file
>
> Combine screencapture with my earlier suggestion of writing each image to the
> appropriate block of a larger array, and then writing out the entire array as
> an image in one step.

So instead of making a structure, write the matrices next to/below eachother to build up a single image? I will try that.

Subject: Saving figures to a single location

From: Travis

Date: 1 Feb, 2010 23:29:05

Message: 10 of 10

"Travis " <sinusoid2@hotmail.com> wrote in message <hk7m9u$2ul$1@fred.mathworks.com>...
> Walter Roberson <roberson@hushmail.com> wrote in message <hk7j3j$t93$1@canopus.cc.umanitoba.ca>...
> > Travis wrote:
> >
> > > screencapture works great, but I still cannot get multiple images to
> > > write a common file
> >
> > Combine screencapture with my earlier suggestion of writing each image to the
> > appropriate block of a larger array, and then writing out the entire array as
> > an image in one step.
>
> So instead of making a structure, write the matrices next to/below eachother to build up a single image? I will try that.

Worked perfectly, thanks guys.

Tags for this Thread

No tags are associated with this thread.

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.

Contact us