Announcement

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

  • Issue with xtline

    Good afternoon everyone,
    I am currently working on a research project. I'm working on creating multiple panel graphs showing GDP trends for several Asian countries from 2005-2020. I've noticed that while some panels display the y-axis labels properly, others are missing them completely (especially for Bangladesh, India, Iran, Kyrgyzstan, and Mongolia panels). Only the bottom panels (Pakistan, Philippines, and Vietnam) show the complete y-axis labels.
    I'd like to know:
    -Why are the y-axis labels missing in some panels?
    -How can I ensure all panels display their y-axis labels consistently?

    Any suggestions would be greatly appreciated. Thank you in advance!
    Click image for larger version

Name:	Graph.jpg
Views:	1
Size:	96.5 KB
ID:	1765114




  • #2
    For this command, as with most graphics commands, Stata follows standard mathematical conventions: The y axis is vertical. The x axis is horizontal. You have them the wrong way round, but the answer's the same.

    What you are seeing is a standard graphical default in Stata. When a by() option is being used -- explicitly or implicitly -- only the axis information on the outside is shown automatically.

    We can't use your data because you don't give a data example. The following is reproducible:

    Code:
    webuse grunfeld, clear
    
    xtset
    
    xtline invest, ysc(log) yla(1 10 100 1000)
    
    xtline invest, ysc(log) yla(1 10 100 1000) byopts(iyaxes ixaxes)
    Here ysc(log) yla(1 10 100 1000) are incidental to your question and just options to get a civilised display of those data.

    What's important to you is that

    Code:
    help xtline
    gives you a link you can click on to learn about what you can feed to byopts().

    Comment

    Working...
    X