Thread Subject: Figure format (tick marks) changed when using print -depsc

Subject: Figure format (tick marks) changed when using print -depsc

From: giordano.sagredo@gmail.com

Date: 22 Feb, 2009 23:05:30

Message: 1 of 3

I made a 3-d figure using scatter3(x,y,z).

Then, changed the tickmarks using:
set(gca,'XTickLabel',num2str([-axlims:2:axlims]'))
set(gca,'YTickLabel',num2str([-axlims:2:axlims]'))
set(gca,'ZTickLabel',num2str([-axlims:2:axlims]'))

It looks gorgeous, perfectly fine in the figure on my screen. Then when I save to eps using:
print -depsc foo

It ends up changing the tick marks on the Z-axis so they are every single unit, not every two as specified in my command line code (and as appeared just fine in my figure).

Help please?

Subject: Figure format (tick marks) changed when using print -depsc

From: Richard Quist

Date: 23 Feb, 2009 13:13:25

Message: 2 of 3

giordano.sagredo@gmail.com wrote:
> I made a 3-d figure using scatter3(x,y,z).
>
> Then, changed the tickmarks using:
> set(gca,'XTickLabel',num2str([-axlims:2:axlims]'))
> set(gca,'YTickLabel',num2str([-axlims:2:axlims]'))
> set(gca,'ZTickLabel',num2str([-axlims:2:axlims]'))
>
> It looks gorgeous, perfectly fine in the figure on my screen. Then when I save to eps using:
> print -depsc foo
>
> It ends up changing the tick marks on the Z-axis so they are every single unit, not every two as specified in my command line code (and as appeared just fine in my figure).
>
> Help please?
By default the figure is resized when printed/saved, and this is probably
what's causing your issue. Assuming fig is the handle to your figure:
   set(fig, 'PaperPositionMode', 'auto');
will tell MATLAB to generate output for the figure at the same size as the
onscreen figure.

You may also need to set the axes XTickMode, YTickMode, and ZTickMode
properties to 'manual'.

Hope that helps.

--

Richard Quist
Software Developer
The MathWorks, Inc.

Subject: Figure format (tick marks) changed when using print -depsc

From: giordano.sagredo@gmail.com

Date: 23 Feb, 2009 14:20:04

Message: 3 of 3

Richard Quist suggested:
>set(fig, 'PaperPositionMode', 'auto');
>will tell MATLAB to generate output for the figure at the >same size as the onscreen figure.

Thank you very much, Richard. That did the trick! Yippee!

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 Richard Quist 23 Feb, 2009 08:13:41
paperpositionmode Richard Quist 23 Feb, 2009 08:13:41
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