Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: automating multiple graphs to be exported from a do file

From   "b. water" <>
Subject   Re: st: RE: automating multiple graphs to be exported from a do file
Date   Sat, 29 Nov 2003 16:14:58 +0000


Thanks for your info. I thought so too, that there's no other way if the preceeding commands were all differents.


From: "Nick Cox" <>
To: <>
Subject: st: RE: automating multiple graphs to be exported from a do file
Date: Sat, 29 Nov 2003 11:44:57 -0000

The crucial detail here is that the information
leading up to each command differs. That being
so, it is difficult to suggest ways of speeding
this up very much. You could save yourself
a little typing by a one-off program like

program myexport
	version 8
	graph export `0'.wmf

so that if you type

myexport filename1

it gets expanded to

graph export filename1.wmf

Of course you could use a shorter name.
And such a program would need watching
carefully for complicated Windows-names
with spaces, etc.

As soon as you're doing _essentially_
the same stuff again and again, the
picture changes.


b. water
> Win98se, Stata 8.2.
> I have thought about this problem but quite happy with the
> status quo at the
> moment. So if no solution I am ok but would like to hear
> any offer of advice/help.
> Do-file:
> Blah
> Blah
> Blah
> gr blah blah
> graph export filename1.wmf
> Bloh
> Bloh
> Bloh
> gr bloh bloh
> graph export filename2.wmf
> Blih
> Blih
> Blih
> gr blih blih
> graph export filename3.wmf
> Bluh
> Bluh
> Bluh
> gr bluh bluh
> graph export filename_n.wmf
> So, right now I only have 12 graphs to produce. So in my
> do-file I don't
> mind cutting, pasting, and naming the graph in increments.
> I can imagine
> though that if I have a bit more to do, it might be more
> efficient to write
> ala Nick (Cox)'s one (or two liners) to automate this task.
> At the moment
> this is beyond me and I do not know whether this can be
> done e.g. using for val stuffs.
> By the way, the routines above the individual graph command are all
> different.

*   For searches and help try:
Need a shot of Hank Williams or Patsy Cline? The classic country stars are always singing on MSN Radio Plus. Try one month free!

* For searches and help try:

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