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: RE: graph hbar - different colors for different groups defined by an external variables


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: graph hbar - different colors for different groups defined by an external variables
Date   Fri, 20 Sep 2013 15:07:47 +0000

Alice,

Try:

. graph hbar yvar, over(geo) asyvars bar(1, color(black)) bar(2,color(gray)) bar(3,color(white))

Or were you hoping to have something more general that doesn't depend on knowing the ordering of the -geo-?

Regards,
Joe Canner
Johns Hopkins University School of Medicine

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alice Guerra
Sent: Friday, September 20, 2013 10:53 AM
To: [email protected]
Subject: st: graph hbar - different colors for different groups defined by an external variables

Dear Statalists,

I was wondering if it would be possible to have different colors in a graph hbar for different groups. The groups are defined by an external variable.

In my dataset, I have the Italian regions. I want to plot them in a graph hbar, and I want to color the bars of the Northern regions in black, the bars of the Southern regions in gray, and the central regions in white. the external variable for the geographic ripartition of regions is called "geo".

Thank you for your time and help.

Best regards

Alice
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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