Announcement

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

  • how to make pie graph with categories and subcategories?

    Dear all,
    Could somebody tell me how to make pie charts containing categories and subcategories? Like under different industry categories (different colors across different categories), there are specific industries(same color within the same industry category)? Thank you a lot!

    Click image for larger version

Name:	categories.jpg
Views:	1
Size:	310.8 KB
ID:	1561167

  • #2
    Jonny,

    I'd suggest rereading the guidelines on posting, so that folks know something about the data you're working with and what you've tried so far. In particular: What should I say about the commands and data I use?

    If you haven't tried anything yet, why not try:

    Code:
    webuse census
    graph pie pop, over(region) plabel(_all name)
    and then:
    Code:
    help graph pie
    as well as the pdf-docs.

    In any case, information about the data that you are trying to plot will help folks help you.

    Comment


    • #3
      Arthur Morris gives excellent advice, but the sting here is that getting all the way to similar graphs will be difficult in Stata, despite various tricks you can use, including insisting that different slices (sectors) have the same colour.

      I count about 10 sectors and 3 "countries" (sure, the EU is not a country) and could suggest any number of bar charts that would be much clearer in my view. Presumably these aren't your own data, so posting those real data would make suggestions much easier.

      Comment


      • #4
        Originally posted by Nick Cox View Post
        Arthur Morris gives excellent advice, but the sting here is that getting all the way to similar graphs will be difficult in Stata, despite various tricks you can use, including insisting that different slices (sectors) have the same colour.

        I count about 10 sectors and 3 "countries" (sure, the EU is not a country) and could suggest any number of bar charts that would be much clearer in my view. Presumably these aren't your own data, so posting those real data would make suggestions much easier.
        Hi Nick, thanks for replying! The point of my graph is just to show the proportions, thus pie chart is the best way. Could you tell me how to set colors by groups of observations in Stata? For example,

        Company Industry IndustryCategory
        A Food Low-tech
        B Aerospace High-tech
        C Chemicals High-tech
        D Food Low-tech
        E Electronics High-tech

        I would like to make a pie chart showing percentages of numbers of companies. In the chart we have Food, Aerospace etc in each slice. But I would like Industries within the same industry category to be in the same color? Is there a way to do that?

        Comment


        • #5
          This is wide open to anyone who wants to advise Johnny on pie charts.

          Comment

          Working...
          X