Bookmark and Share

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

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

RE: st: graph export for journal

From   "Kieran McCaul" <>
To   <>
Subject   RE: st: graph export for journal
Date   Mon, 9 Aug 2010 04:32:35 +0800


further to this, whichever path you take to getting cmyk colours in a
tiff file, Stata only exports cmyk colours to eps or ps files and you'll
need to regenerate the graphs defining the colours you want using cmyk
values.  See -help colorstyle- for more details.

But I agree with Phil, most journals will accept eps files, so check
with the editors first.

-----Original Message-----
[] On Behalf Of Kieran McCaul
Sent: Monday, 9 August 2010 4:09 AM
Subject: RE: st: graph export for journal


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.

-----Original Message-----
[] On Behalf Of Phil Schumm
Sent: Sunday, 8 August 2010 11:40 PM
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)-  

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: (cross platform) (GraphicConverter, OS X only) (Windows only; I've never used it)

-- Phil

*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

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