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]

st: AW: RE: AW: help with twoway bar chart using by option


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: RE: AW: help with twoway bar chart using by option
Date   Thu, 18 Feb 2010 16:55:40 +0100

<> 


True, the -by()- option makes the "text()" specification cumbersome, so
Miranda has to go to greater lengths...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Nick Cox
Gesendet: Donnerstag, 18. Februar 2010 16:51
An: [email protected]
Betreff: st: RE: AW: help with twoway bar chart using by option

This may help you start. 

sysuse auto, clear
collapse (mean) mean = mpg, by(foreign rep78) 
gen text = cond(foreign, "goodbye", "hello") 
su mean, meanonly 
gen y = 1.1* r(max)
gen x = 4 
twoway bar mean rep78, by(foreign) || scatter y x, ms(none) mla(text)

Nick 
[email protected] 

Martin Weiss

You want to look at

*************
help added_text_options
*************

Miranda Kim

I am a Stata v11 user, and would very much appreciate any suggestions on

the following:

I would like to produce a twoway bar chart using the by option, for
example:

For example:
sysuse auto, clear
collapse (mean) mean = mpg, by(foreign rep78)
twoway bar mean rep78, by(foreign)

I would then like to insert a different text box in each plot area.

So in the example above, how could I insert a text box in the "Domestic"

plot area that says "hello" and a textbox in the foreign area that says 
"goodbye"?

At present, I only know how to insert a textbox that is replicated in 
both plot areas...

The graph I am producing has many more formatting specifications to make

it look nice, but I have just used the above example to help illustrate 
the specific issue I cannot, at present, resolve.

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