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

st: RE: bug in color(black) for twoway bar ?

From   David Airey <>
Subject   st: RE: bug in color(black) for twoway bar ?
Date   Wed, 31 Aug 2005 11:04:01 -0500


My apologies for assuming what I could not figure out in over an hour must be something wrong with Stata rather than me (!). Your advice was easier to implement that that of the Stata's tech help, which was rapidly in by inbox and also works, but there was a complication.

In your command,

graph twoway bar y x, barwidth(0.5) bstyle(none) color(black) ylabel(0 (25)100)

does not give filled black for me. I must instead say

graph twoway bar y x, barwidth(0.5) bstyle(none) bfcolor(black) ylabel (0(25)100)

neither color(black) nor blcolor(black) are paid attention to.


Dear David,

The intensity level of the bar color in -twoway bar- is set at 80% and the
line intensity is set at 100%. I believe this is done in order to
differentiate between the bars (since -twoway bar- places the bars right next
to each other by default).

While the -graph bar- command allows for an -intensity- option, the -twoway
bar- command does not. The intensity level is set in the scheme file, so you
would need to alter the scheme in order to change this behavior. If you want
to go to the trouble, you could change the following line in the
scheme-s2color.scheme (the s1color scheme uses settings in s2color) file:


intensity p inten80


intensity p inten100

Then, when you issue your -twoway bar- command with the -bfcolor (black)-
option your bars will turn out as black as the bars in -graph bar-.

Derek Wagner

This is neither platform-specific nor a bug - it is a "feature"

The default intensity for all shaded areas in twoway plots is 80%. You can override this by removing the style before applying the colour...

graph twoway bar y x, barwidth(0.5) bstyle(none) color(black) ylabel (0(25)100)


-----Original Message-----
[]On Behalf Of David Airey
Sent: 31 August 2005 01:22
Subject: st: bug in color(black) for twoway bar ?


On OS X Stata 9, it seems impossible to get black bars for twoway bar
graphs. It is possible in graph bar.

For example,


set scheme s1color

input y x
35 1
45 2
55 3

// produce dark gray bars
graph twoway bar y x, barwidth(0.5) color(black) ylabel(0(25)100)

// produces black bars
graph bar y x, bar(1, color(black)) bar(2, color(black))

/* about produces

Stata/SE 9.0 for Macintosh
Born 05 Jul 2005
Copyright (C) 1985-2005

*   For searches and help try:

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