Announcement

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

  • Change the display number on the axes

    Hi everybody.

    I would like to change the way observations are displayed on the axes (for example I have on the x axes the years displayed as: 1800,1805,1810,...). I would like to have instead all the years displayed on the axes (1900,1901,1902,...). Also for the y axes I have the same problem.

    Thank you.

    Best

  • #2
    As you don't show the code you are using, it is not possible to give specific advice how to revise it. Suffice it to say that the two way graph commands in Stata have -xlabel()- and -ylabel()- options that enable you to control what is shown. You can see how they work by comparing the results of:

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . graph twoway scatter price mpg
    
    . graph twoway scatter price mpg, xlabel(10(5)45) ylabel(0(250)15000)
    You will note from the results of using -ylabel(0(250)15000)- in the second graph that if you choose to display too many values, they will overlap and create an unreadable mess. To some extent you can mitigate that problem with the -alternate- and -angle()- suboptions, or by making the typeface smaller with the -labsize()- suboption. But these approaches also affect readability in their own way. If you have a large number of years, displaying every single year is probably not going to work well. But you won't know for sure till you experiment with it.

    Do see -help axis_label_options- for more details.

    Comment

    Working...
    X