Bookmark and Share

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: Bar colors in graph


From   Richard Ohrvall <[email protected]>
To   statalist <[email protected]>
Subject   st: Bar colors in graph
Date   Tue, 21 Aug 2012 11:33:16 +0200

Dear Statalist,

I am creating some bar graphs where I would like fill some bars with a
different color based on the values for some other variable (or in
some cases the variable I use to create the groups). Eg. if I create
the following graph

sysuse auto, clear
graph hbar (mean) price, over(rep78, sort(price) descending)

I would like the bars to be blue except where rep78==3 in which case I
would like them to be yellow. I assume there is some way to do this in
some way, but I haven't found it. I could do it manually in the graph
editor, but that is not a viable solution in  this case.

Any help would be greatly appreciated.

All the best,
Richard
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index