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: graph export for journal


From   "Kieran McCaul" <[email protected]>
To   <[email protected]>
Subject   RE: st: graph export for journal
Date   Mon, 9 Aug 2010 04:09:28 +0800

...

You can also use Ghostscript to convert eps files to another format.
Friedrich Huebler's webpage has details on how to do this together the
code for calling Ghostscript from within Stata.
The example is for generating a png file, but it will do tiff as well.

http://s281191135.onlinehome.us/2005/20050407_Stata_PNG.html



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Phil Schumm
Sent: Sunday, 8 August 2010 11:40 PM
To: [email protected]
Subject: Re: st: graph export for journal

On Aug 7, 2010, at 4:32 PM, Ricardo Ovaldia wrote:
> I have several Stata Kaplan-Meir curves (st graph) in an article  
> accepted for publication. The wanted the graphs in tiff format which  
> I provide using -graph export-. However, they do not like how they  
> looks. They now want tiff files with a minimal resolution of 300 dpi  
> and CMYK rather than RGB. Can I do this in Stata or am I going to  
> remake the graphs in another software?


I'm guessing that you're talking to someone in the front office rather  
than in the graphics department.  Requesting an image in CMYK seems  
reasonable, since the conversion from RGB to CMYK is not perfect  
(e.g., some of the colors that can be represented in RGB cannot be  
represented in CMYK, and you will sometimes notice a color shift after  
conversion).  However, the graphics department should be perfectly  
happy with an Encapsulated PostScript (EPS) file, since they can then  
use this at whatever resolution they want.  So, if I were you, I'd ask  
the person you're communicating with to check with the graphics  
department if EPS figures with CMYK would be acceptable.  If so, you  
can generate them in Stata using -graph export- with the -cmyk(on)-  
option.

If they continue to insist on TIFF format with the CMYK color space,  
then I don't believe you can generate these directly with Stata  
(someone please correct me if I'm wrong).  You can modify the  
resolution of a TIFF image when exporting with -graph export- by using  
the -width()- and -height()- options, but you can't specify the CMYK  
color space.  Thus, I'd suggest exporting as EPS with CMYK, and then  
using some other application to convert this to a 300 dpi (or higher)  
TIFF image (while retaining the CMYK colors).  I'm not a graphics  
person so I don't own Photoshop, but I'd guess that it can handle this  
if you have access to it.  GIMP, unfortunately, doesn't support  
working with CMYK images, though there is a plugin called Separate  
which adds this functionality (I've never used it).  I generally use  
the Python Imaging Library (PIL) for such tasks, which can be easily  
installed for those using Linux/OS X (on which Python comes pre- 
installed) or Windows users who install Python.  PIL provides a rich  
set of tools for generating and manipulating images, and since it is  
in the form of a Python library, these functions can be easily  
scripted or accessed from other applications.

If you don't have access to Photoshop and aren't already familiar with  
PIL and/or Python, it would probably be easier just to use an image  
conversion program, many of which are freely available on the web.   
For example, here are a few:

     http://www.imagemagick.org/ (cross platform)
     http://www.lemkesoft.com/ (GraphicConverter, OS X only)
     http://www.irfanview.com/ (Windows only; I've never used it)


-- Phil

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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