Statalist The Stata Listserver

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

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

From   "White, Justin" <[email protected]>
To   <[email protected]>
Subject   RE: st: twoway bar: Can't control the bar colors
Date   Mon, 18 Sep 2006 08:43:58 -0400

Here is some code I use.  Notice the *bar* command.  This will control
the color of the bar.

graph hbar ur, over(state_name, sort(rank) label(labsize(medium)))
nofill ytitle("Percent (%)")
title("Neighbor State Unemployment Rates", color(black) span)
blabel(bar, position(inside) format(%9.1f) color(white) size(small)
justification(center) alignment(middle))

bar(1, blwidth(thick) bcolor(red))

graphregion(color(gs15) margin(l-3 b-3))
caption("Source: Bureau of Labor Statistics, LAUS Data - July 2006
(Seasonally Adjusted)", span size(vsmall));

Hope this helps.

Justin White

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Gawrich
Sent: Monday, September 18, 2006 8:28 AM
To: '[email protected]'
Subject: AW: st: twoway bar: Can't control the bar colors 

> 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) 
> Im using Intercooled Stata 9.2 (Aug 2006-Version) on Windows XP.
> ----------------------------------------------------------------
Svend Juul wrote: 
> I use Stata 9.2 on Windows XP, too, and the following works perfectly:
> clear
> set obs 21
> gen points = _n-1
> gen count=round(50*uniform())
> twoway                                            ///
>   (bar count points if points <= 6, color(red))   ///
>   (bar count points if points == 7, color(green)) ///
>   (bar count points if points > 7, color(blue))


Thanks Svend for the test, now it's clear that it's some special error
has nothing to do with the code. 
I also tried it with Intercooled 9.1 Stata on a XP-Notebook, same thing.

twoway bar count points, color(red) 
-> (option color() not allowed - R198)

other graphs:
scatter count points, mcolor(red)
 -> works
graph bar count , over(points) bar(1 color(red)) 
-> works (but of no use for me)
line count points, lcolor(red) 
-> (option color() not allowed - R198)

I also did a Stata repair install and checked the color.class and
color-style files. 

So I will contact Stata about this, perhaps they have a clue.

Best wishes 


Dr. Stefan Gawrich
Hesse State Health Office
35683 Dilllenburg

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index