Announcement

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

  • Changing size of axis labels produced by graph bar

    This code produces a bar graph that I believe correctly represent the essence of my problem.
    Code:
    sysuse auto, clear
    graph bar weight, over(foreign) ylabel(,labsize(small))
    Click image for larger version

Name:	BarGraph.png
Views:	1
Size:	90.5 KB
ID:	1384955

    As you can see from the code and barely see on the graph, I was able to find an appropriate set of options to reduce the size of the labels on the y axis. I've been unable to do the same for the labels on the group axis. If I open this graph in Stata's Graph Editor and click on the group axis, I see that the object is called "grpaxis" and I am able to change the "Label Size" characteristic from "Medium Small" to "Small" to produce what I want. But how do I instruct Stata to do that when it creates the graph?

  • #2
    This may not be the answer you are looking for but one workaround is:
    Code:
    graph bar weight, over(foreign) scale(*.5)

    Comment


    • #3
      Thank you, I hadn't thought of that workaround. However, it changes all the text, including the yaxis title, rather than just the axis labels. I think I could work around that, but my hope was for something more direct that would only affect the axis labels, either on both axes, or just on the group axis (since I know how to do the yaxis).

      Comment


      • #4
        Code:
        graph bar weight, over(foreign, label(labsize(small))) ylabel(,labsize(small))
        This is documented in help graph bar, under "group_options".

        Comment


        • #5
          Ah yes, I see it now, in help graph bar##over_subopts. Thanks for pointing me in the right direction, reasoning by analogy with the yaxis led me to overlook the group options.

          Comment


          • #6
            Originally posted by Friedrich Huebler View Post
            Code:
            graph bar weight, over(foreign, label(labsize(small))) ylabel(,labsize(small))
            This is documented in help graph bar, under "group_options".
            Thanks so much!

            Comment

            Working...
            X