[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Bar labels in stacked bar chart
I found a simple answer to my question. -catplot- can create the same
graph as -graph bar- after the data has been recoded.
. recode rep78 3=1 4=2 5=3 1=4 2=5
. catplot bar rep78 foreign, percent(foreign) asyvars stack
--- Friedrich Huebler <email@example.com> wrote:
> Thank you, -catplot- is easier to use than -graph bar- because
> several steps can be skipped. Another advantage is that -catplot-
> works with numeric values and strings.
> However, with -graph bar yvars, over(varname) stack- it is possible
> to stack the bars in a specific order by varying the order in which
> the yvars are listed.
> . sysuse auto
> . tab rep78, gen(rep)
> . graph bar rep3 rep4 rep5 rep1 rep2, over(foreign) stack percent
> Can the same be accomplished with -catplot-?
> Thank you.
> Friedrich Huebler
> --- Nick Cox <firstname.lastname@example.org> wrote:
> > Another way to do it is (in total)
> > . catplot bar rep78 for , percent(for) asyvars stack
> > blabel(bar, pos(center) format(%3.2f))
> > where I've added a format control. Here -catplot- can be
> > installed from SSC.
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
* For searches and help try: