Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to graph pie like this?

    Click image for larger version

Name:	1.png
Views:	1
Size:	351.5 KB
ID:	1492442

    As above, how to draw the concentric circles?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte teamSize
     3
     2
     3
    10
     3
     3
     1
     2
     2
     8
     3
     3
     2
     4
     3
     3
     3
     5
     3
     1
     3
     5
     3
     6
     3
     2
     2
     2
     3
     3
     1
    10
     3
     1
     6
     1
     2
     5
     4
     2
    11
     5
     4
     1
     3
     3
     4
     4
     3
     6
     3
     2
     3
     3
     3
     2
     4
     3
     2
     1
     1
     4
     6
     3
     3
     2
     5
     3
     3
     1
     3
     3
     2
     5
     4
     2
     4
     7
     2
     3
     2
     3
     2
     2
     3
     3
     4
     4
     4
     2
     2
     2
     2
     3
     3
     2
     3
     1
     2
     1
    end
    graph pie ,over(teamSize)  legend(ring(0) pos(3) col(1)) pie(3,explode) plabel(1 percent) plabel(2 percent) plabel(3 percent) plabel(4 percent) plabel(5 percent)

  • #2
    That is not a good graph. Think about how we humans decode the information from a graph. The "bending" of the bars only makes it harder to compare them, especially when we compare graphs on the inside, where the bending has to be more extreme, and the outside. So just forget about that graph.

    Instead look at something like this:
    Code:
    graph dot (percent) , over(teamSize)
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Alright, thanks.

      Comment


      • #4
        I agree strongly with Maarten Buis . As it happens, the graph design in #1 is not easily available in Stata without customised programming, unless there is a community-contributed command lurking somewhere, but minimally you have to show about 10 frequencies or percents and the strain on the reader would be great.

        I don't understand the popularity of such designs one bit. Some bad examples appear in a recent book: see my review (and compare the others...) at https://www.amazon.com/MakeoverMonda.../dp/1119510775

        Thanks for your data example. Here is a graph for the pie chart code in #1 (there could be differences if people use a different scheme) and one of several possible alternatives in Maarten's spirit.

        Code:
        set scheme s1color
        
        graph pie ,over(teamSize)  legend(ring(0) pos(3) col(1)) pie(3,explode) ///
        plabel(1 percent) plabel(2 percent) plabel(3 percent) plabel(4 percent) plabel(5 percent) name(Fred1, replace)
        
        histogram teamSize, discrete percent yla(1/11, ang(h) noticks) horizontal ///
        bfcolor(eltgreen*0.2) blcolor(eltgreen*2) addlabels addlabopts(mlabsize(medlarge))    ///
        barw(0.9) ysc(reverse)xsc(off) ytitle("") subtitle(% of each team size) ysc(r(. 12)) name(Fred2, replace)
        Click image for larger version

Name:	Fred1.png
Views:	1
Size:	31.8 KB
ID:	1492455



        Click image for larger version

Name:	Fred2.png
Views:	1
Size:	15.7 KB
ID:	1492456



        I often like graph-table hybrids. If the frequencies or percents are shown as text, then the corresponding axis labels are no longer needed. The histogram is helpful here to respect the detail that there were no teams of size 9. Even if the fuller dataset fills in that gap, there may be others. Showing bars with widths a little less than 1 is a way to put subtle emphasis on the discreteness of the scale, but clearly not compulsory. Even more at choice are a horizontal alignment and bar colour(s).

        Do people need to be persuaded that the pie chart does not work well?

        Comment

        Working...
        X