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

st: RE: Stata 8 graphics, bar charts (stacked), color of labels


From   Ulrich Kohler <kohler@wz-berlin.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: Stata 8 graphics, bar charts (stacked), color of labels
Date   Wed, 15 Sep 2004 16:04:59 +0200

Andreas,

I think there is no direct way to tackle this. However it seems feasable to 
use -graph twoway bar- as a workaround. "Stack" your bars "by hand" and 
overlay a scatter with invible markes to label the bars. 

For example to stak bars of v1 and v2 you can proceed like this:

. gen vstack = v1 + v2
. graph twoway 
 (bar vstack xvar) 
 (bar v1 xvar) 
 (sc vstack v1 xvar, mlabel(v2 v1) mlabcolor(white blue) mlabpos(6 6) s(i i))

Hope that helps

uli


Andreas Stiehler wrote:
> Thank you Nick,
>
> but with the -bar(#, bcolor())- option I can only determine the color
> (and characteristics) of the bars - not of the labels (I am right?).
> For a dark bar color, for example, I would like to use white labels and
> vice versa. Is there any way to do that (without using boxes)?
>
> Kind regards,
> Andreas
>
> Am 15.09.2004 um 14:32 schrieb Nick Cox:
> > Use the -bar(#, bcolor())- option and sub-option.
> >
> > Nick
> > n.j.cox@durham.ac.uk
> >
> > Andreas Stiehler
> >
> >> is there a way to determine the color of labels in stacked bars
> >> individually similar the one for pie charts,
> >> e.g.
> >> plabel(1 percent, color(white) format(%9.0f)) ///
> >> plabel(2 percent, color(black) format(%9.0f)) ///
> >> plabel(3 percent, color(white) format(%9.0f)) ///
> >> plabel(4 percent, color(black) format(%9.0f)) ///?
> >
> > *
> > *   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/
>
> Dr. Andreas Stiehler
> Analyst
>
> Berlecon Research GmbH
> Oranienburger Straße 32
> D-10117 Berlin
> Fon: +49 30 285296-0
> Fax: +49 30 285296-29
> E-Mail: tw@berlecon.de
>
> Web: www.berlecon.de
> Analysten-Weblog: weblog.berlecon.de
> Newsletter-Abo: mailto:berlecon-aktuell-subscribe@berlecon.de
> --------------------------------------------------------------------
> Berlecon Research - Wir analysieren das Potenzial neuer Technologien
> --------------------------------------------------------------------
>
>
> *
> *   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/

-- 
kohler@wz-berlin.de
+49 (030) 25491-361


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