Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: adding info to bar graph


From   "Buzz Burhans" <[email protected]>
To   <[email protected]>
Subject   RE: st: adding info to bar graph
Date   Wed, 09 Apr 2008 14:33:18 -0400

Scott,

Thanks for the explanation.  I should have thought of setting trace on to
figure it out.  I was puzzled by the "5" and couldn't see why/how the two
sets of double quotes worked. Your recursive use of `mytext' is quite also
interesting in this solution, especially since it starts out empty -which
also initially confused me.

Thanks for the macro lesson.

Buzz 

Buzz Burhans, Ph.D.

Dairy-Tech Group

Twin Falls, ID
Phone: 208-320-0829
Fax: 208-735-1289 

So. Albany VT
Phone: 802-755-6842

Email: [email protected]

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Merryman
Sent: Wednesday, April 09, 2008 2:13 PM
To: [email protected]
Subject: Re: st: adding info to bar graph

On Wed, Apr 9, 2008 at 12:34 PM, Nick Cox <[email protected]> wrote:
> "5" looks like a typo: delete it.

No, in this case I am using the -text()- option; the "5" specifies the
location on y-axis for the text boxes.

As Nick pointed out the the line appends stuff to the local macro as
it loops through the levels of rep78.

If you -set trace on- you can see work it through adding text to the
local macro:

- foreach l of local levels {
...
- local mytext "`mytext' 5 `l'   "`n'/`d'"  "
= local mytext " 5 1   "0/2"  "
- }
...
- local mytext "`mytext' 5 `l'   "`n'/`d'"  "
= local mytext " 5 1   "0/2"   5 2   "0/8"  "
- }
...
- local mytext "`mytext' 5 `l'   "`n'/`d'"  "
= local mytext " 5 1   "0/2"   5 2   "0/8"   5 3   "3/30"  "
...
...

Scott
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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