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:
Better quality graphics in PUBLISH output

Subject: Better quality graphics in PUBLISH output

From: Doug Weathers

Date: 14 Jul, 2010 19:33:04

Message: 1 of 8

Hi,

I am working on a MATLAB program that needs to produce a nice-looking report.

The PUBLISH command is very nearly perfect, except the quality of the graphics that end up in the report are not very impressive. They look terrible when printed.

I can manually export a figure to a PDF file and it prints out beautifully. I would like some way to get this to work with PUBLISH.

Does anyone have any suggestions or alternatives?

Thanks,

Doug

Subject: Better quality graphics in PUBLISH output

From: Doug Weathers

Date: 16 Jul, 2010 20:53:04

Message: 2 of 8

No replies yet, so I'm adding some more information.

When I say the quality of images produced with the PUBLISH command is "terrible", I mean that the resolution is poor. It looks like it's being printed in screen resolution (72dpi) instead of the printer resolution (600dpi).

The only place I can find to set the resolution of an image is when you're printing it.

At first I was exited when I saw that the Figure Capture Method parameter for the publishing configuration included "print" as a method. However, all that does is set the background to white.

I can improve the look of the output images by making them as big as possible on my screen, but I can't make them big enough to make me happy with them. Plus what happens when someone with a bigger/smaller screen runs my code?

I thought I had a workaround - export the image to a bitmap, then use the <<filename>> image include trick for the PUBLISH command. But that doesn't appear to work for publishing to a PDF file.

There's just got to be a good way to solve this problem, but I haven't had any luck finding it.

Could someone give me some tips?

Thanks,

Doug

"Doug Weathers" <dougw@spamcop.net> wrote in message <i1l3dg$ab4$1@fred.mathworks.com>...
> Hi,
>
> I am working on a MATLAB program that needs to produce a nice-looking report.
>
> The PUBLISH command is very nearly perfect, except the quality of the graphics that end up in the report are not very impressive. They look terrible when printed.
>
> I can manually export a figure to a PDF file and it prints out beautifully. I would like some way to get this to work with PUBLISH.
>
> Does anyone have any suggestions or alternatives?
>
> Thanks,
>
> Doug

Subject: Better quality graphics in PUBLISH output

From: Loren_Shure

Date: 19 Jul, 2010 11:37:28

Message: 3 of 8


"Doug Weathers" <dougw@spamcop.net> wrote in message
news:i1qgrg$i18$1@fred.mathworks.com...
> No replies yet, so I'm adding some more information.
>
> When I say the quality of images produced with the PUBLISH command is
> "terrible", I mean that the resolution is poor. It looks like it's being
> printed in screen resolution (72dpi) instead of the printer resolution
> (600dpi).
>
> The only place I can find to set the resolution of an image is when you're
> printing it.
>
> At first I was exited when I saw that the Figure Capture Method parameter
> for the publishing configuration included "print" as a method. However,
> all that does is set the background to white.
>
> I can improve the look of the output images by making them as big as
> possible on my screen, but I can't make them big enough to make me happy
> with them. Plus what happens when someone with a bigger/smaller screen
> runs my code?
>
> I thought I had a workaround - export the image to a bitmap, then use the
> <<filename>> image include trick for the PUBLISH command. But that
> doesn't appear to work for publishing to a PDF file.
>
> There's just got to be a good way to solve this problem, but I haven't had
> any luck finding it.
>
> Could someone give me some tips?
>
> Thanks,
>
> Doug
>
> "Doug Weathers" <dougw@spamcop.net> wrote in message
> <i1l3dg$ab4$1@fred.mathworks.com>...
>> Hi,
>>
>> I am working on a MATLAB program that needs to produce a nice-looking
>> report.
>>
>> The PUBLISH command is very nearly perfect, except the quality of the
>> graphics that end up in the report are not very impressive. They look
>> terrible when printed.
>>
>> I can manually export a figure to a PDF file and it prints out
>> beautifully. I would like some way to get this to work with PUBLISH.
>>
>> Does anyone have any suggestions or alternatives?
>>
>> Thanks,
>>
>> Doug

Doug-

There are configuration options for publish. You can access them in the
editor where the publish button is and set some of the details about figures
there. Not sure if it has all you want, but that's a place to start.

--Loren

Subject: Better quality graphics in PUBLISH output

From: us

Date: 19 Jul, 2010 12:10:45

Message: 4 of 8

"Loren_Shure" <loren.shure@mathworks.com> wrote in message <i21ddo$7bh$1@fred.mathworks.com>...
>
> "Doug Weathers" <dougw@spamcop.net> wrote in message
> news:i1qgrg$i18$1@fred.mathworks.com...
> > No replies yet, so I'm adding some more information.
> >
> > When I say the quality of images produced with the PUBLISH command is
> > "terrible", I mean that the resolution is poor. It looks like it's being
> > printed in screen resolution (72dpi) instead of the printer resolution
> > (600dpi).
> >
> > The only place I can find to set the resolution of an image is when you're
> > printing it.
> >
> > At first I was exited when I saw that the Figure Capture Method parameter
> > for the publishing configuration included "print" as a method. However,
> > all that does is set the background to white.
> >
> > I can improve the look of the output images by making them as big as
> > possible on my screen, but I can't make them big enough to make me happy
> > with them. Plus what happens when someone with a bigger/smaller screen
> > runs my code?
> >
> > I thought I had a workaround - export the image to a bitmap, then use the
> > <<filename>> image include trick for the PUBLISH command. But that
> > doesn't appear to work for publishing to a PDF file.
> >
> > There's just got to be a good way to solve this problem, but I haven't had
> > any luck finding it.
> >
> > Could someone give me some tips?
> >
> > Thanks,
> >
> > Doug
> >
> > "Doug Weathers" <dougw@spamcop.net> wrote in message
> > <i1l3dg$ab4$1@fred.mathworks.com>...
> >> Hi,
> >>
> >> I am working on a MATLAB program that needs to produce a nice-looking
> >> report.
> >>
> >> The PUBLISH command is very nearly perfect, except the quality of the
> >> graphics that end up in the report are not very impressive. They look
> >> terrible when printed.
> >>
> >> I can manually export a figure to a PDF file and it prints out
> >> beautifully. I would like some way to get this to work with PUBLISH.
> >>
> >> Does anyone have any suggestions or alternatives?
> >>
> >> Thanks,
> >>
> >> Doug
>
> Doug-
>
> There are configuration options for publish. You can access them in the
> editor where the publish button is and set some of the details about figures
> there. Not sure if it has all you want, but that's a place to start.
>
> --Loren

unfortunately, there's no documented option to tweak the resolution...

us

Subject: Better quality graphics in PUBLISH output

From: Doug Harriman

Date: 9 Aug, 2010 19:04:04

Message: 5 of 8

"Doug Weathers" <dougw@spamcop.net> wrote in message <i1l3dg$ab4$1@fred.mathworks.com>...
> Hi,
>
> I am working on a MATLAB program that needs to produce a nice-looking report.
>
> The PUBLISH command is very nearly perfect, except the quality of the graphics that end up in the report are not very impressive. They look terrible when printed.
>
> I can manually export a figure to a PDF file and it prints out beautifully. I would like some way to get this to work with PUBLISH.
>
> Does anyone have any suggestions or alternatives?
>
> Thanks,
>
> Doug

Doug -

I made a little progress by modifying this line in publish.m:

x = hardcopy(tempfigure,'-dzbuffer','-r0');

You can increase the rendered resolution by increasing the '-r' value. I tried '-r600'. While there resolution seemed to go up, the render time went up significantly, and the HTML report seemed to just have larger images, which no longer fit inline with the text. Seems like a step in the right direction, but more work needed to keep more pixels from just increasing image size.

 - Doug

Subject: Better quality graphics in PUBLISH output

From: Toby Driscoll

Date: 21 Oct, 2010 15:34:10

Message: 6 of 8

I will add +1 to requesting this capability!

  -- Toby

"Doug Harriman" <dharriman@xzeres.com> wrote in message <i3pjf4$2ae$1@fred.mathworks.com>...
> "Doug Weathers" <dougw@spamcop.net> wrote in message <i1l3dg$ab4$1@fred.mathworks.com>...
> > Hi,
> >
> > I am working on a MATLAB program that needs to produce a nice-looking report.
> >
> > The PUBLISH command is very nearly perfect, except the quality of the graphics that end up in the report are not very impressive. They look terrible when printed.
> >
> > I can manually export a figure to a PDF file and it prints out beautifully. I would like some way to get this to work with PUBLISH.
> >
> > Does anyone have any suggestions or alternatives?
> >
> > Thanks,
> >
> > Doug
>
> Doug -
>
> I made a little progress by modifying this line in publish.m:
>
> x = hardcopy(tempfigure,'-dzbuffer','-r0');
>
> You can increase the rendered resolution by increasing the '-r' value. I tried '-r600'. While there resolution seemed to go up, the render time went up significantly, and the HTML report seemed to just have larger images, which no longer fit inline with the text. Seems like a step in the right direction, but more work needed to keep more pixels from just increasing image size.
>
> - Doug

Subject: Better quality graphics in PUBLISH output

From: John Rogers

Date: 10 Apr, 2012 13:00:10

Message: 7 of 8

Changing '-r0' to '-r600' in publish.m did not work for me, but this did:
Leave publish.m unaltered.

Include these lines in the .m file before the plot command:

figWidth = 1120; % pixels
figHeight = 840;
rect = [0 50 figWidth figHeight];
figure('OuterPosition', rect)

This enlarges the figure window, and Publish captures the enlarged size. The rectangle figWidth x figHeight includes the figure border but the saved figure does not, so the size of the saved figure is smaller, in my case 1104 x 750 pixels.

Cheers,
John

Subject: Better quality graphics in PUBLISH output

From: Yishai Shimoni

Date: 23 Aug, 2012 18:43:07

Message: 8 of 8

"Doug Weathers" <dougw@spamcop.net> wrote in message <i1l3dg$ab4$1@fred.mathworks.com>...
> Hi,
>
> I am working on a MATLAB program that needs to produce a nice-looking report.
>
> The PUBLISH command is very nearly perfect, except the quality of the graphics that end up in the report are not very impressive. They look terrible when printed.
>
> I can manually export a figure to a PDF file and it prints out beautifully. I would like some way to get this to work with PUBLISH.
>
> Does anyone have any suggestions or alternatives?
>
> Thanks,
>
> Doug

Create a new figure, choose file->export setup... and then choose rendering and change the resolution to your desired resolution.
In the publish properties choose "use new figure: false".
When you run publish it will use the values defined for this figure.

Tags for 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