Announcement

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

  • Graph editing

    Hello Statalist!

    I am using the graph below as part of my exploratory data analysis in a cross-sectional study. I've tried toggling different buttons to make the graph clearer. I want to the x-axis to take the numbers (1-12) used in labelling the industries and provide a legend that lists what industry each number represents. Any tips?


    Click image for larger version

Name:	Graph1.jpg
Views:	2
Size:	385.6 KB
ID:	1498089
    Attached Files

  • #2
    I believe you don’t need any legend at all in the x axis, considering the same information was written above the bars. On a slightly different note, the graph could have only the legend in the axis, with a 45-degree display.
    Best regards,

    Marcos

    Comment


    • #3
      Thank you Marcos. Alternatively, how can I remove the labels from the x-axis and leave it blank since the labels above the bars are clear?

      Comment


      • #4
        You ask for advice on how to change a part of the graph command, yet you do not show the command. Note that you have a categorical axis and not an x-axis.

        Code:
        graph bar myvar1, over(myvar2, label(nolab))

        Comment


        • #5
          Thanke you Andrew. Pardon me, the code I used is the following
          Code:
            graph bar (mean) div_prop, over(industry) blabel(group, box) ytitle(Average Proportion of EM Directors)
          >  title(Average Proportion of EM Directors for FTSE 100 Firms) subtitle(by Industry) legend(on)

          Comment


          • #6
            Andrew already gave an insightful advice. As an additional note, I recommend to exclude the legend, since it is already explained in the Y-axis.
            Best regards,

            Marcos

            Comment


            • #7
              I'd use graph hbar here. I also have to ask if the ordering of categories has any rationale.

              You can show us the numbers by (for example)

              Code:
              tab industry, su(div_prop)
              Last edited by Nick Cox; 13 May 2019, 10:33.

              Comment

              Working...
              X