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:
Set both aspect ratio and resolution

Subject: Set both aspect ratio and resolution

From: Sylvia

Date: 29 Jul, 2014 14:41:14

Message: 1 of 2

I want to set both the aspect ratio and resolution in a figure. This seems like a simple task to me, but nothing that I try seems to work. Here is my code:

% plot an annual time series in Figure 1
tS = figure(1);
plot(series)
title(['Annual evolution of nbc sensitivity'],'FontSize',13)
xlim([0 360]); xlabel('day of year','FontSize',10)
ylabel(strcat('dN_i/d(', var,' ) ',label))
set(gca,'FontSize',13);

% here is where I try to get the dimensions and resolution correct
set(gcf, 'PaperOrientation', 'landscape','Units','inches');
set(gcf, 'PaperPositionMode', 'manual');
set(gcf, 'Position', [0.25 2.50 10.50 3.25]);
filename = strcat('28july-nbc-timeseries');
print(tS,'-dtiff','-r600',filename)

However when I open up 28july-nbc-timeseries.tiff, I don't have the 10.5 x 3.25 dimensions that I want. How can I retain my high resolution (600 dpi) and desired dimensions?
Thanks,
Sylvia

Subject: Set both aspect ratio and resolution

From: matt dash

Date: 30 Jul, 2014 13:41:10

Message: 2 of 2

"Sylvia " <sylvia.c.sullivan@gmail.com> wrote in message <lr8bqa$ci6$1@newscl01ah.mathworks.com>...
> I want to set both the aspect ratio and resolution in a figure. This seems like a simple task to me, but nothing that I try seems to work. Here is my code:
>
> % plot an annual time series in Figure 1
> tS = figure(1);
> plot(series)
> title(['Annual evolution of nbc sensitivity'],'FontSize',13)
> xlim([0 360]); xlabel('day of year','FontSize',10)
> ylabel(strcat('dN_i/d(', var,' ) ',label))
> set(gca,'FontSize',13);
>
> % here is where I try to get the dimensions and resolution correct
> set(gcf, 'PaperOrientation', 'landscape','Units','inches');
> set(gcf, 'PaperPositionMode', 'manual');
> set(gcf, 'Position', [0.25 2.50 10.50 3.25]);
> filename = strcat('28july-nbc-timeseries');
> print(tS,'-dtiff','-r600',filename)
>
> However when I open up 28july-nbc-timeseries.tiff, I don't have the 10.5 x 3.25 dimensions that I want. How can I retain my high resolution (600 dpi) and desired dimensions?
> Thanks,
> Sylvia

You are setting the position property but you need to be setting the paperposition property.

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