Statalist The Stata Listserver

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

st: graphs, conditional coloring of bars

From   "H Wright" <>
Subject   st: graphs, conditional coloring of bars
Date   Thu, 26 Jan 2006 20:28:37 +0000

Given this example, is it possible to have the bars with greater than 20mpg
come up in some other color, like yellow?

Thank you for any help.
  sysuse auto,

     gen mfg=word(make,1)
     sort mfg fore
     by mfg fore: keep if _n>3

     * now there is a reasonable size

     collapse mpg, by(mfg fore)
     save temp, replace
     gen year=1990
     append using temp
     replace year=2000 if year==.
     replace mpg=mpg*1.1 if year==2000

     graph bar mpg, over(year) over(mfg) asyvars

*   For searches and help try:

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