Announcement

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

  • Graph hbar labels cut off

    Hello listers,

    I would like to produce a simple bar chart with
    Code:
    graph hbar (sum) var1 inst1, over(inst_type, sort(1) descending)
    inst_type contains about 20 different string values, none of them super long nor with special characters in it. But Stata keeps cutting the labels off like this:
    Click image for larger version

Name:	hbar_graph.png
Views:	1
Size:	13.0 KB
ID:	1411224


    I tried many things like changing the axis scale, label size, aspect ratio but nothing helped. Does someone have a hint what the problem could be?
    The same does not happen with all bar charts, some look perfectly fine.

  • #2
    Regardless of what "super long" means, in my experience this happens when at least one label is too long for graph hbar to handle. I'd change the aspect ratio and also edit the longest label to go on two lines, and so on, until it works.

    Comment


    • #3
      Ok, thank you Nick for that quick reply!

      Comment


      • #4
        You can also experiment with different settings for the left margin of the graph region.
        Code:
        graphregion(margin(10 2 2 2))
        graphregion(margin(-10 2 2 2))

        Comment

        Working...
        X