Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: twoway bar: Can't control the bar colors


From   Gawrich Stefan <s.gawrich@hlpug.hessen.de>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: twoway bar: Can't control the bar colors
Date   Fri, 15 Sep 2006 09:37:08 +0200

Hello,

seems this posting missed the list yesterday for unknown reasons, so here it
comes again:

I want to graph a series of frequency distributions of integer point scales,
each with two cut points.
One example: Scale 0-20, cut points at 7 and 8 -> three intervals (0-6; 7;
8-20)

There are several graph solutions (first would be the histogram) but I
decided to collapse the data to a frequency distribution:

points  count 
0		2		
1		5	
2		11	
3		45	
...
20		3		

...and do a combination of three twoway bar graphs:
twoway bar count points if points <= 6 || bar count points if points == 7 ||
bar count points if points >= 8 & points <= 20

This gives me the graph I want, except that I would like to change the bar
colors of the three graphs to red, yellow and green.

*******************************

Using the "color" option for each graph I always get error R198 "option
color() not allowed". Code Example: 
twoway bar count points if points <= 6, color(red) 

But I can't see the difference of my command to the description in "help
barlook_options" under "Remarks": 

"barlook_options are also allowed as options with graph twoway bar and graph
twoway rbar, as in
        . graph twoway bar yvar xvar, color(green)"

Im using Stata 9.2 (Aug 2006-Version) on Windows XP.

This must be some kind of easy mistake but I'm not getting it. Anybody got
an idea?

Best wishes 

Stefan Gawrich
Hesse State Health Office
35683 Dilllenburg
Germany
*
*   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