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

st: RE: changing appearance of boxplots


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: changing appearance of boxplots
Date   Sat, 23 Jul 2005 13:48:39 -0500

Jack,

I don't believe there is any option to directly change the color of the
median line for only one group, however if you -separate- your y-variable
the -box(2,...)- option will work.

For example:

sysuse auto,clear

graph box mpg, medtype(line) over(foreign) over(rep78) /// 
  box(1, fcolor(white) lcolor(black)) name(gr1, replace) 

separate mpg, by(fore)

graph box mpg0 mpg1, medtype(line) over(foreign) over(rep78) /// 
 box(1, fcolor(white) lcolor(black)) box(2, fcolor(black) ///
 lcolor(gs12)) legend(off) name(gr2, replace)


This does change the color of the outline of the box and the whiskers as
well, hence the light gray color (gs12) rather than white.


Hope this helps,
Scott


________________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of Jack Rabi
Sent: Friday, July 22, 2005 1:13 PM
To: [email protected]
Subject: st: changing appearance of boxplots

I have created a boxplot with two groups (boxes) for each category.� I want
to change the appearance of the median line for the white boxes to black so
that they are easier to see.� How do I change the color of the median line
for only one of the two groups.� I have included the command I tried below.�
This produces a faint greyish white median line within the boxplot.�
Couldn't find the answer in the graphics manual. 
graph box avgo2,� over(cs1) over(cage) asyvars medtype(cline) box(2,
bcolor(black)) box(1, bfcolor(white) blcolor(black))boxgap(10)
ytitle("SpO2") b2title("Minutes")legend(cols(1) position(5) ring(0) lab(1
"Vaginal delivery") lab(2 "Cesarean delivery")) 
Regards, 
Jack 
-- 
Jack Rabi MD, FRCPC 
Neonatologist 
Assistant Professor (University of Calgary Dept. of Pediatrics) 
Foothills Medical Centre 
Room C211 
1403-29th Street NW 
Calgary, AB 
T2N 2T9 
Tel:� [403] 944-1615 
Fax: [403] 944-4892 
�



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