Thread Subject: export_fig: image resolution/size

Subject: export_fig: image resolution/size

From: RUSSELL

Date: 8 Oct, 2009 18:20:19

Message: 1 of 7

hi there

I have finally managed to get my figures to have transparency via export_fig! yeee haaaa!
for anyone wondering how this is done, i had to set :

set(gca,'color','none')
set(gcf,'color','none')

and then

export_fig('-png','-nocrop','-opengl','-r300','outputfilename')

however, i cant seem to get the output image to change size in resolution and dimensions. i have searched the help and forum extensively but nothing seems to work.

I have tried things like:

export_fig('PaperUnits','centimeters','PaperSize',[20. 20.],'-dpng','-nocrop','-opengl','-r2000','Testpng')
 
but nothing happens.. have also put the papersize command in the

figure(...) bit.


changing -r in the export_fig doesnt seem to do anything.. every time i open the output file its quite small and around 72dpi

any suggestions would be great!!!!!

cheers
Russ
 




 

Subject: export_fig: image resolution/size

From: the cyclist

Date: 8 Oct, 2009 18:39:03

Message: 2 of 7

"RUSSELL " <r.johnston@physics.gla.ac.uk> wrote in message <halah3$2ak$1@fred.mathworks.com>...
> hi there
>
> I have finally managed to get my figures to have transparency via export_fig! yeee haaaa!
> for anyone wondering how this is done, i had to set :
>
> set(gca,'color','none')
> set(gcf,'color','none')
>
> and then
>
> export_fig('-png','-nocrop','-opengl','-r300','outputfilename')
>
> however, i cant seem to get the output image to change size in resolution and dimensions. i have searched the help and forum extensively but nothing seems to work.
>
> I have tried things like:
>
> export_fig('PaperUnits','centimeters','PaperSize',[20. 20.],'-dpng','-nocrop','-opengl','-r2000','Testpng')
>
> but nothing happens.. have also put the papersize command in the
>
> figure(...) bit.
>
>
> changing -r in the export_fig doesnt seem to do anything.. every time i open the output file its quite small and around 72dpi
>
> any suggestions would be great!!!!!

I think you need to set the 'PaperPosition' attribute of the figure object.

Subject: export_fig: image resolution/size

From: RUSSELL

Date: 8 Oct, 2009 19:02:02

Message: 3 of 7

"the cyclist" <thecyclist+mathworks_newsgroup@gmail.com> wrote in message <halbk7$gjj$1@fred.mathworks.com>...
> "RUSSELL " <r.johnston@physics.gla.ac.uk> wrote in message <halah3$2ak$1@fred.mathworks.com>...

> I think you need to set the 'PaperPosition' attribute of the figure object.

do you mean:

figure1=figure('paperunits','centimeters','paperposition', [0 0 20 20]);

if so, nothing changes

Subject: export_fig: image resolution/size

From: Oliver Woodford

Date: 9 Oct, 2009 08:36:02

Message: 4 of 7

Hi Russ

export_fig doesn't take all the options that print does. I'm considering adding in the ability to increase resolution with an input parameter, but at the moment that feature isn't available.

However, as stated in the help text, export_fig exports figures exactly as they appear on screen - that includes the size. If you want a larger (i.e. higher resolution) image, make the figure larger.

HTH,
Oliver




"RUSSELL " <r.johnston@physics.gla.ac.uk> wrote in message <halah3$2ak$1@fred.mathworks.com>...
> hi there
>
> I have finally managed to get my figures to have transparency via export_fig! yeee haaaa!
> for anyone wondering how this is done, i had to set :
>
> set(gca,'color','none')
> set(gcf,'color','none')
>
> and then
>
> export_fig('-png','-nocrop','-opengl','-r300','outputfilename')
>
> however, i cant seem to get the output image to change size in resolution and dimensions. i have searched the help and forum extensively but nothing seems to work.
>
> I have tried things like:
>
> export_fig('PaperUnits','centimeters','PaperSize',[20. 20.],'-dpng','-nocrop','-opengl','-r2000','Testpng')
>
> but nothing happens.. have also put the papersize command in the
>
> figure(...) bit.
>
>
> changing -r in the export_fig doesnt seem to do anything.. every time i open the output file its quite small and around 72dpi
>
> any suggestions would be great!!!!!
>
> cheers
> Russ
>
>
>
>
>
>

Subject: export_fig: image resolution/size

From: Oliver Woodford

Date: 9 Oct, 2009 10:02:02

Message: 5 of 7

"Oliver Woodford" wrote:
> export_fig doesn't take all the options that print does. I'm considering adding in the ability to increase resolution with an input parameter, but at the moment that feature isn't available.

Hold the phone. I've just added the ability to export bitmaps at an arbitrary resolution, and uploaded it to the FEX. It should appear within the next few days.

The resolution is changed with the -m<value> option (not the -r<value> option used by print), where value is the factor to magnify the on-screen figure dimensions by. I.e. -m2.5 produces a bitmap with 2.5 times the resolution of the source figure. Hopefully this is more intuitive than dpi.

Oliver

Subject: export_fig: image resolution/size

From: RUSSELL

Date: 9 Oct, 2009 13:28:02

Message: 6 of 7

"Oliver Woodford" <o.j.woodford.98@cantab.net> wrote in message <hamsli$r8t$1@fred.mathworks.com>...
> Hi Russ
>
> export_fig doesn't take all the options that print does. I'm considering adding in the ability to increase resolution with an input parameter, but at the moment that feature isn't available.
>
> However, as stated in the help text, export_fig exports figures exactly as they appear on screen - that includes the size. If you want a larger (i.e. higher resolution) image, make the figure larger.
>
> HTH,
> Oliver


Hi Oliver

Thanks for taking the time to reply! :@) and i will most certainly checkout your extended bmp version when it appears!!

Ok, one last stupid question...(as you will have guessed, i am new to this):

Lets say, for example, that i plot the figure to the screen (which i have been doing). it will always appear small unless i physically drag the corner tab of the window to make it bigger or if i select 'Figure Properties', at whcih point it jumps to a huge square size on the screen.

From here, how do i use export_fig to export the figure at this new size?
If i am talking absolute rubbish, then where exatly in the code do i state the figure size?

Currently the code looks something like:
--------------------
figure1=figure;
axes1 = axes('Parent',figure1,'FontWeight','bold','FontSize',16);
set(gca,'color','none')
set(gcf,'color','none')
xlim([0 360]);
ylim([-100 100]);
box('on');
hold('all');
xlabel({'Right Ascension (DD)'},'FontWeight','demi','FontSize',20,'FontName','Times',...
    'FontAngle','normal');
ylabel({'Declination (DD)'},'FontWeight','demi','FontSize',20,'FontName','Times',...
    'FontAngle','normal');

plot(raSIXDF,decSIXDF,'MarkerSize',2,'Marker','.','Color',[.49 1 .63],'LineStyle','none');

export_fig('-dpng','-nocrop','-opengl','-r200','Test')


------------------

many thanks (in advance)

Russ

Subject: export_fig: image resolution/size

From: RUSSELL

Date: 9 Oct, 2009 13:36:03

Message: 7 of 7


HI Oliver

Ignore that last message i posted... i figured it out!! duh!

by the way - you're script is great!

cheers

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
size Oliver Woodford 9 Oct, 2009 04:39:06
export_fig RUSSELL 8 Oct, 2009 14:24:03
resolution RUSSELL 8 Oct, 2009 14:24:03
papersize RUSSELL 8 Oct, 2009 14:24:03
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