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

st: RE: barplot x-axis labels


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: barplot x-axis labels
Date   Mon, 28 Feb 2005 19:13:43 -0000

Arnold's posting started a thread, 
a sort of bass-baritone duet with
David Harrison. (Either may be 
a tenor, for all I know, but 
I am thinking of a piece from 
"The Pearl Fishers".) 

A remark orthogonal to the solution: 

if you -reshape long- these data, 
then other possibilities fall into 
view, including -catplot- from SSC. 

Nick 
n.j.cox@durham.ac.uk 

Arnold Kester
 
> I have been trying to make a decent plot similar to the included .do 
> file below, but I cannot get the organ names ("Nose", "Lung", 
> "Kidney", 
> ..) below the bars. Stata insists putting "mean of BiopNose", 
> etc. when 
> I ask for labels, and puts in in the wrong place.
> 
> I am aware that the plot contains very little information.
> 
> Thanks,
> Arnold Kester
> 
> ==============================================
> * barplot problem
> 
> clear
> 
> set obs 100
> 
> gen BiopNose= (uniform()<.6)
> gen BiopKidney= (uniform()<.3)
> gen BiopLung= (uniform()<.5)
> gen BiopSkin= (uniform()<.2)
> gen BiopMuscle= (uniform()<.2)
> 
> graph bar (mean) Nose=BiopNose Kidney=BiopKidney Lung=BiopLung ///
>    Skin=BiopSkin Muscle=BiopMuscle, ///
>    yt(Percent of patients) ///
>    ylabel(0 "0" 0.2 "20" 0.4 "40" 0.6 "60" 0.8 "80") ///
>    bargap(20) bar(1, bfcolor(ltblue)) bar(2, bfcolor(ltblue)) ///
>               bar(3, bfcolor(ltblue)) bar(4, bfcolor(ltblue)) ///
>               bar(5, bfcolor(ltblue)) ///
>    blabel(name) legend(off)
> 
> exit
> * ====================================

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