Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: hbar graph & colour
From 
 
María Edo <[email protected]> 
To 
 
[email protected] 
Subject 
 
st: hbar graph & colour 
Date 
 
Sat, 19 Feb 2011 22:57:12 -0300 
Hello,
I need to construct a horizontal bar graph using three colours: two
different colours to highlight two particular bars (say, red and
green) and one colour for the rest of the bars (say, blue).
So far, I have managed to get two colours in the graph by using the
-over- option:
input country   gdp   flag1 flag2
1  100    0       0
2  110    0       1
3  240    1       0
4  50     0       0
5  10     0       0
end
graph hbar  gdp, asyvars over(flag1) over(country, sort( gdp)
descending) bar(1, color(blue)) bar(2, color(red)) stack
To get the graph I need, country "2" should appear in green.
I am sure there is a trivial way of achieving this, but I haven't been
able to find it.
Many thanks,
Maria
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/