Thread Subject: Save background color of figure in PNG

Subject: Save background color of figure in PNG

From: Martina

Date: 27 Oct, 2011 12:14:29

Message: 1 of 3

I changed the background color of a figure and want to save that figure as .png. Normally, background colors aren't saved. How can I change that?

I tried set(gcf,'InvertHardcopy','off'), but that didn't help.

Any ideas?

Subject: Save background color of figure in PNG

From: Oliver Woodford

Date: 27 Oct, 2011 23:35:31

Message: 2 of 3

"Martina " <sir.henry2@gmx.net> wrote in message <j8bhv5$5o9$1@newscl01ah.mathworks.com>...
> I changed the background color of a figure and want to save that figure as .png. Normally, background colors aren't saved. How can I change that?
>
> I tried set(gcf,'InvertHardcopy','off'), but that didn't help.
>
> Any ideas?

Export_fig, on the file exchange, saves figures as they appear on screen.

Subject: Save background color of figure in PNG

From: TideMan

Date: 28 Oct, 2011 00:20:00

Message: 3 of 3

On Oct 28, 1:14 am, "Martina " <sir.hen...@gmx.net> wrote:
> I changed the background color of a figure and want to save that figure as .png. Normally, background colors aren't saved. How can I change that?
>
> I tried set(gcf,'InvertHardcopy','off'), but that didn't help.
>
> Any ideas?

In my routines, I always set the figure first:

hfig=figure;

set(hfig,...
    'InvertHardcopy','off',...
    'Position',[200 100 769 576],...
    'PaperPositionMode','auto',...
    'Color',bgcol)

plot(etc........)


print('-dpng','MyPic')

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
color figure png Martina 27 Oct, 2011 08:14:30
rssFeed for this Thread

Contact us at files@mathworks.com