Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

RE: st: Beginner questions re saving/storing/exporting graphs in Windows


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: Beginner questions re saving/storing/exporting graphs in Windows
Date   Mon, 18 Oct 2010 15:25:38 +0100 (BST)

--- On Mon, 18/10/10, Maarten buis <maartenbuis@yahoo.co.uk> wrote:
> Alternatively, you could expand the basic file a bit, like
> this:
> *------------begin basic example ------------------- 
> cd "c:\temp"
> file open basic using basic.html, write replace
> file write basic `"<html><body>"' _n  // <-- new
> sysuse auto, clear
> foreach var of varlist mpg-trunk {
>     hist `var'
>     graph export `var'.png, replace
>     file write basic `"<img
> src="`var'.png"> <br>"' _n 
> } 
> file write basic `"<\body><\html>"' _n // <-- new
> file close basic
> *----------- end basic example ----------------------

Kit Baum pointed out privately that I made an error:

The line
file write basic `"<\body><\html>"' _n // <-- new

should have been
file write basic `"</body></html>"' _n // <-- new

Thanks,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index