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

st: RE: How to make this graph?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: How to make this graph?
Date   Thu, 16 Oct 2003 10:10:22 +0100

FF NN

> I want to draw a somewhat tricky graph, at least for
> me. I have a variable "occu_before" recording people's
> occupations before some time, with the range coded
> from 1 to 9; and another variable "occu_after"
> recording people's occupations after some time, with
> the range coded from 1 to 9 as well.
> Now I want to make a bar graph, with the x axis being
> the "occu_before". Let's look at occu_before=1, then I
> want to draw the bar which counts how many people have
> the before-occupation of 1, plus, this bar is stacked
> by 9 small bars each of which, say, the ith, denotes
> how many people from the before-occupation 1 have the
> after-occupation i, so on and so forth.

Check out the user-written program -catplot- from SSC. 

. ssc inst catplot 

. whelp catplot 

. catplot bar occu_before occu_after, asyvars stack legend(cols(3)) 

. catplot hbar occu_before occu_after, asyvars stack legend(cols(3)) 

Nick 
[email protected] 

*
*   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