Statalist


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

st: Multiline Relabeling graph & plotting piecharts with foreach


From   Beth Gifford <[email protected]>
To   [email protected]
Subject   st: Multiline Relabeling graph & plotting piecharts with foreach
Date   Thu, 19 Jun 2008 14:00:41 -0400

Hello there, I have 2 graph questions.

1.  Splitting labels into multiline for bar graph with multiple dummy variables
I have the following graph
graph hbar  q6_coverage q6_currentmem q6_planmember, percentage legend(off) 
bargap(8) yvaroptions(relabel(1 "Observed Summit Coverage in Local Media"  2
"Current DO prevention workgroup or Organization Member"  3 "Planning to serve
on a do prevention workgroup post-summit"))

I can't figure out how to break up the long lines for the 3 different variables.
 yvaroptions does not allow multi-line labels.  Legend does--but that is not
what I am looking for.  These are 3 different dummy variables so I don't think
the over(relabel) options are what I am looking for.  any suggestions?

2.  Pie Chart with Foreach: Different #'s of Slices
In my pie chart, I wanted to plot the missing values as grey.  However, I am
generating the same plot over multiple sites using foreach.  Sometimes, one of
the categories has 0 responses so there are different numbers of slices which
throws off my desired color scheme.  Is there a way so that I can fix the
colors based on the value of the slice?


graph pie, over(quality) legend(off) title("Overall Quality of the Summit",
color(yellow)) pie(5, color(gs7) ) pie(1, color(navy)) pie(2, color(blue))
pie(3,color(gold)) pie(4, color( orange_red ))   plabel(_all percent, gap(11)
color(white) size(*1.5) format(%9.2g) )  plabel(_all name, size(*1.5)
color(white)) note("Source: Attendees of the `vlab' summit", color(yellow) )
plotregion(color(khaki)) graphregion(color(navy)) angle(180)

Thanks for your help!
Beth

Beth Gifford, PhD
Research Scientist
Center for Child and Family Policy
Duke University

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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