Statalist


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

Re: st: Multiple graphs in .do file


From   Alan Neustadtl <alan.neustadtl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Multiple graphs in .do file
Date   Thu, 17 Sep 2009 18:41:41 -0400

Stata is replacing each graph sequentially since by default graphs are
named "Graph".  Look at the following example:

/* Example #1 BEGIN */

sysuse uslifeexp2, clear
scatter le year
scatter le year, connect(l)

/* Example #1 END   */

While two graphs will be created only one will remain after the
program concludes and it will be called "Graph".  The next example
uses the "name" option (see "help name_option" for more information)
to produce two plots.

/* Example #2 BEGIN */

sysuse uslifeexp2, clear
scatter le year, name(graph1, replace)
scatter le year, name(graph2, replace) connect(l)

/* Example #2 BEGIN */

Best,
Alan


On Thu, Sep 17, 2009 at 11:46 AM, Michael Crain
<michaelcrain@hotmail.com> wrote:
> In my .do file, I am creating several graphs (scatterplots). But when each graph is created in the routine, the graph window of the previous graph is closed by Stata. Thus, at the end of the .do routine I have only one graph showing even though my .do file created several graphs.
>
> Is there a way to control whether graph windows (from multiple graphs) stay open or closed in a .do file?
>
> Stata v. 10
>
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> http://clk.atdmt.com/GBL/go/171222986/direct/01/
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index