Thread Subject: Saveas to specific size

Subject: Saveas to specific size

From: Travis

Date: 20 Feb, 2009 23:32:06

Message: 1 of 6

How do I use the saveas command and have it save a s a specific size? I want to save all figures with varying aspect ratios with a 6" x 3" size.

Subject: Saveas to specific size

From: Richard Quist

Date: 21 Feb, 2009 02:30:36

Message: 2 of 6

Travis wrote:
> How do I use the saveas command and have it save a s a specific size? I want to save all figures with varying aspect ratios with a 6" x 3" size.
Setting the figure's PaperPosition property should take care of this for you.
The default PaperPosition results in a figure that is 8 x 6 inches

   set(fig, 'PaperPosition', [0 0 6 3]);

--

Richard Quist
Software Developer
The MathWorks, Inc.

Subject: Saveas to specific size

From: Allan

Date: 25 Jun, 2010 19:34:21

Message: 3 of 6

When I use saveas() to save a figure in the .eps format for inclusion in a latex file, the figure as it appears in the resulting .pdf file has lost its color. This doesn't happen when I use File -> Save As from the menu and select .eps as the file type.

The only two colors I am using are black (RGB = [0 0 0]) and gray (RGB = [.5 .5 .5]). Yet in the .pdf file, all the graph lines are black.

> Setting the figure's PaperPosition property should take care of this for you.
> The default PaperPosition results in a figure that is 8 x 6 inches

Subject: Saveas to specific size

From: Sourav Chatterjee

Date: 25 Jun, 2010 20:16:00

Message: 4 of 6

using "print" might be a better option.(Try using the eps color option "-depsc" instead of the black and white option).
If that does not help, you can also try doing :
set(gcf, 'InvertHardCopy', 'off');
because sometimes the colors are changed when the figure is being printed.



"Allan " <allan.yarbrough@afit.edu> wrote in message <i030bt$kfb$1@fred.mathworks.com>...
> When I use saveas() to save a figure in the .eps format for inclusion in a latex file, the figure as it appears in the resulting .pdf file has lost its color. This doesn't happen when I use File -> Save As from the menu and select .eps as the file type.
>
> The only two colors I am using are black (RGB = [0 0 0]) and gray (RGB = [.5 .5 .5]). Yet in the .pdf file, all the graph lines are black.
>
> > Setting the figure's PaperPosition property should take care of this for you.
> > The default PaperPosition results in a figure that is 8 x 6 inches

Subject: Saveas to specific size

From: Allan

Date: 28 Jun, 2010 19:17:19

Message: 5 of 6

Thanks, yes, print does preserve the size, but it turns off the grid lines! Again, this only happens from the command line use of print, not from using "Save As" from the figure menu. Still, with a lot of graphs, it would be nice to automate this.

Thanks in advance for any help you can offer.

Subject: Saveas to specific size

From: us

Date: 28 Jun, 2010 19:28:04

Message: 6 of 6

"Allan " <allan.yarbrough@afit.edu> wrote in message <i0asfv$ba2$1@fred.mathworks.com>...
> Thanks, yes, print does preserve the size, but it turns off the grid lines! Again, this only happens from the command line use of print, not from using "Save As" from the figure menu. Still, with a lot of graphs, it would be nice to automate this.
>
> Thanks in advance for any help you can offer.

a hint:
- look at this, which shows you how to use a style sheet programmatically
- this is done by ...save as...

http://www.mathworks.com/matlabcentral/newsreader/view_thread/162796#411767

us

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
print us 28 Jun, 2010 15:29:14
hgexport us 28 Jun, 2010 15:29:14
style sheet us 28 Jun, 2010 15:29:14
code us 28 Jun, 2010 15:29:14
reference us 28 Jun, 2010 15:29:14
grid Allan 28 Jun, 2010 15:19:19
figure color Allan 25 Jun, 2010 15:39:25
saveas Travis 20 Feb, 2009 18:35:07
size Travis 20 Feb, 2009 18:35:07
figure Travis 20 Feb, 2009 18:35:06
rssFeed for this Thread

Contact us at files@mathworks.com