Announcement

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

  • How do I adjust my overlapping labels in panel data line plots?

    Hi, I cannot seem to find how to adjust overlapping labels on my yaxis in my panel data line plots (xtline).

    Previously I had used the option label(angle(45)) for a graph bar, but this does not seem to work for xtline. I have tried several byopts() but they were all unsuccessful.

    Does anyone know how I can incline my labels so that they do not overlap? Numbers are pretty big and I need them to appear as such.

    Thanks in advance,


    Pauline



  • #2
    Hi Pauline. Perhaps one solution would be to try changing the scale of your axis using axis-options yscale(range(0 10000)) where 0 and 10000 are the min and max of the axis or you can scale the axis ylabel(1(2)10) where 1 and 10 are the min and max and the tickets are at 2 so the axis would be 0, 2, 4, 6, 8, 10. Hope this helps.

    Comment


    • #3
      Welcome to the Stata Forum / Statalist.

      The best approach to entail a helpful reply is to provide data (real, mock or abridged) as well as command.

      You may wish to take a look at the FAQ, particularly on the use of CODE delimiters and the installation of the SSC dataex.

      That said, if I understand right, you may fiddle with the angle() option.
      Best regards,

      Marcos

      Comment


      • #4
        Dear both, thank you for your replies.

        Senor SR, I have tried changing the scale of my axis but this didn't work either.

        Marcos, I will make sure to provide data in the future to support my enquiry and look into these.

        In the meantime, I have found the solution (I was missing a comma in front of 'angle'), as well as an alternative, which is to change the direction of my labels from vertical to horizontal.
        xtline involvedinlegal involvedintotal, ylabel(,angle(45)) byopts(rescale)

        xtline involvedinlegal involvedintotal, ylabel(,angle(horizontal)) byopts(rescale)

        Best,


        Pauline

        Comment

        Working...
        X