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


From   Michael McCulloch <[email protected]>
To   [email protected]
Subject   Re: st: Beginner questions re saving/storing/exporting graphs in Windows
Date   Mon, 18 Oct 2010 11:19:40 -0700

Ben, I've also used another approach:
*** begin example
sysuse cancer.dta, clear
sts graph, by(drug)
graph export "your file name.pdf", replace
graph export "your file name.tif", replace
*** end example
Michael


On Oct 18, 2010, at 11:08 AM, Sergiy Radyakin wrote:

> 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:\output.zip" `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:
>> *   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/


Best wishes,

Michael McCulloch, LAc MPH PhD
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391


*
*   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