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: Beginner questions re saving/storing/exporting graphs in Windows

From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: Beginner questions re saving/storing/exporting graphs in Windows
Date   Mon, 18 Oct 2010 14:08:06 -0400

On Thu, Oct 14, 2010 at 12:10 AM, Benhoen2 <[email protected]> wrote:
> I need a quick primer on how to get multiple graphs from the graph window
> into a file that then I can save for later, send to others.  I once again
> put my faith in the Stata online community will get me started down the
> right path.  (FYI I spent the last hour or so trying to understand how to
> use graph export and epstopdf, and seem to have gotten more confused than
> anything.)
> I will create 20 or so graphs in my .do file and want to find the most
> elegant way to get them from the graph window to one file, which I can send
> out.  I had assumed I would use a  MS Word or PDF file to receive the output
> but if other options are readily available please suggest.

The most natural option seems to be a ZIP archive. The recepient may
decide on how to use the files.
Here is an example:

version 11
sysuse auto
levelsof rep78, local(rep)

local templist ""
foreach one_rep in `rep' {
	scatter price weight if rep78==`one_rep'
	tempfile gph
	graph export `gph', as(png)
	local templist `"`templist' "`gph'""'

if (`"`templist'"'!="") {
	_zipfile "r:\" `templist', overwrite

If you want to embed images into an HTML file, you have to use CHM
format (possible, but not convenient).
The above solution is platform-independent (portable) and does not
require anything beyond standard Stata 11 (10 should probably work
with perhaps min changes).

Best Sergiy.

> I had envisioned being able to export to a file, in the same way one exports
> output to a log.  Once all of the graphs have been exported (the .do file is
> complete) the file would be ready to send.  The key here is that one file
> would contain multiple graphs and that the process would be automated from
> within the .do file.
> I am running Stata SE 11.1 on Windows 7 64 bit box.
> Any advice on how I might get started?  Is this even possible?
> Thanks,
> Ben
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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