Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: high-DPI eps or emf files


From   László Sándor <[email protected]>
To   [email protected]
Subject   Re: st: high-DPI eps or emf files
Date   Tue, 4 Feb 2014 12:43:11 -0500

Sergiy, Friedrich,
Thanks for all the careful attention. I still cannot offer you much
about friends' systems. "Could the problem be due to your coauthor's
display settings?" Maybe. Though he definitely uses a newish PC with
Windows 7 and a recent Office, probably 2010, as far as the drivers
are concerned. I know even less about the display settings, but what
display setting could cause such a problem?

In any case, he had the problem with an eps file, but they always had
similar problems with wmf files in the past (which are bad for
coauthors on a mac anyway, but are editable). What they documented as
a workaround is definitely a hack that is sad if needed in an
otherwise automated workflow:

"To make the images in Word sharps do the following:
1. Save the figures as wmfs.
2. Insert each figure into a powerpoint presentation.
3. You might like to select the figure, right-click ungroup, delete
the extra background (white squares) and adjust the spacing between
the figure and the legend.
4. Copy each figure and "paste as picture" into Word."

I hope these gave clues, sorry I cannot be more specific. I am
hesitant to recommend PNGs, as vector based graphics are much nicer
once one makes PDFs out of the documents.

Thanks again,

Laszlo

On Tue, Feb 4, 2014 at 10:09 AM, Friedrich Huebler <[email protected]> wrote:
> Sergiy,
>
> Thank you for the clarification and for having mentioned the article.
> The Ghostscript workaround to control the size of a PNG image was
> suggested by Stata tech support in 2005, before the width() and
> height() options were added to -graph export- when exporting to PNG.
> With Stata 9.1 this workaround became obsolete. The only benefit of
> Ghostscript is now that it can create antialiased PNG images. I will
> edit the article to make this clearer.
>
> Friedrich
>
> On Mon, Feb 3, 2014 at 10:46 PM, Sergiy Radyakin <[email protected]> wrote:
>> On Mon, Feb 3, 2014 at 6:58 PM, Friedrich Huebler <[email protected]> wrote:
>>> Laszlo, I am unable to reproduce your problem. How are you adding the
>>> exported EMF file to your Word document? Could the problem be due to
>>> your coauthor's display settings?
>>>
>>> Sergiy mentioned an article by me and wrote that it "apparently quotes
>>> a method recommended by StataCorp". To my knowledge StataCorp has not
>>> stated its opinion (positive or negative) on any of the methods that I
>>> described. When I wrote the article in April 2005 it was not possible
>>
>> Friedrich, perhaps I misread the following: "The alternative method to
>> create PNG files was suggested to me by Stata technical support:....."
>> in your article. Anyhow, whether this is your own or somebody else's
>> advice - it is very useful. Thank you for taking time to write it down
>> and put online.
>> Best, Sergiy Radyakin
>>
>>> to specify the size of an exported PNG graph with Stata. This option
>>> was added in Stata 9.1, released in September 2005 (see -help
>>> whatsnew9-). My article is still useful, even with Stata 13, because
>>> it shows how antialiased PNG graphs can be created with the help of
>>> Ghostscript.
>>
>>
>>
>>>
>>> Friedrich
>>>
>>> On Mon, Feb 3, 2014 at 6:10 PM, László Sándor <[email protected]> wrote:
>>>> Thanks, Sergiy, this was very helpful.
>>>>
>>>> The blurry issue happens on a coauthor's PC, and I won't bother him
>>>> for a screenshot. In any case, I found some references about poor
>>>> behavior with eps or emf:
>>>> http://forums.adobe.com/message/2002708
>>>> http://stackoverflow.com/questions/1422949/emf-with-forced-antialiasing
>>>>
>>>> So maybe I will try PDF, now available even under Stata for Windows.
>>>> But why would that be better, I am not sure. And of course, EMF graphs
>>>> could still be edited later one, while PDFs could not be. I am amazed
>>>> that the graphics drivers for Windows formats are so bad on Windows.
>>>> (OK, eps is not a Windows format, of course.)
>>>>
>>>> Still, thanks a lot!
>>>>
>>>> Laszlo
>>>>
>>>> On Mon, Feb 3, 2014 at 3:34 PM, Sergiy Radyakin <[email protected]> wrote:
>>>>>
>>>>> Laszlo,
>>>>> wmf file is using a predefined logical coordinates which nominally map
>>>>> to about 22 and 3/4 inches (32768*1/1440). Vector files are commands
>>>>> (programs) for the executor on how to draw them. Different executors
>>>>> may decide to draw them with a different degree of tolerance, or
>>>>> interpret the commands (and distances) any way they like. That is
>>>>> controlled by the mapping mode, and there is at least half a dozen of
>>>>> those.
>>>>>
>>>>> I suggest you try a different "player". E.g. if you currently embed a
>>>>> graph into Word, try to visualize the file in e.g. IrfanView, and  see
>>>>> whether it is still blurry. If necessary, convert to PNG with
>>>>> IrfanView.
>>>>>
>>>>> You can specify "resolution" in emf files. That's because there you
>>>>> can embed pictures, and hence the whole graph can be represented as
>>>>> one huge embedded picture in the EMF. Usually one can identify it from
>>>>> the file size it skyrockets from a few kb to a few mb with this. I
>>>>> don't think Stata will allow you doing this. IrfanView will save an
>>>>> image as EMF.
>>>>>
>>>>> This older article by Friedrich Huebler apparently quotes a method
>>>>> recommended by StataCorp:
>>>>> http://huebler.blogspot.com/2005/04/creating-png-images-with-stata.html
>>>>>
>>>>> I'd go with a high resolution PNG, which I can later rescale with
>>>>> IrfanView (select the slowest subsampling method, nowadays it takes
>>>>> <1sec for any graph anyways, but the quality varies substantially).
>>>>>
>>>>> Finally, blurry look on the screen doesn't automatically mean blurry
>>>>> printing. Try it out.
>>>>>
>>>>> How blurry is blurry? Can you share the a) original emf/wmf file; and
>>>>> b) document with embedded blurry graph.
>>>>>
>>>>> Best, Sergiy Radyakin
>>>>>
>>>>> On Mon, Feb 3, 2014 at 2:16 PM, László Sándor <[email protected]> wrote:
>>>>> > Hi,
>>>>> >
>>>>> > I am mostly using Stata 13.1 MP for mac, but if I need to generate emf
>>>>> > files, then of course this is about Stata 13.1 MP for Windows.
>>>>> >
>>>>> > I have the problem of eps or emf files generated with -graph export-
>>>>> > do not seem high-resolution ("are blurry") in documents later on. I am
>>>>> > no expert on these formats, but this sounds strange for vector
>>>>> > graphics formats. Is the size of the image too small, then, and other
>>>>> > apps magnify these file formats incorrectly? Can this is be fixed in
>>>>> > Stata?
>>>>> >
>>>>> > I found this note, if it is relevant:
>>>>> > http://stackoverflow.com/questions/2553300/dpi-for-emf-files
>>>>> >
>>>>> > Or is the following the only solution, really? A manual hack?
>>>>> > http://stackoverflow.com/questions/15388048/change-resolution-of-emf-image-files-to-prevent-quality-loss-in-powerpoint
>>>>> >
>>>>> > If you have any experience with this, your thoughts would be more than welcome.
>>>>> >
>>>>> > Thanks,
>>>>> >
>>>>> > Laszlo
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index