Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Bar colors in graph


From   Richard Ohrvall <richard.ohrvall@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index