Announcement

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

  • Issue with Missing Legend Numbers in Trajplot in Stata

    Hello everyone,

    I am currently working with in Stata, and I'm encountering an issue when generating two separate graphs. Specifically, the legend numbers on the second graph are not displaying, although they show up correctly on the first graph.trajplot

    Here is the code I am using to generate the two graphs:

    trajplot, model(1) xtitle(Following year) ytitle(Frailty index) ylabel(0(1)5) ci
    graph save "$working_data/traj1", replace

    trajplot, model(2) xtitle(Following year) ytitle(CES-D score) ylabel(0(1)5) ci
    graph save "$working_data/traj2", replace

    In the first graph (), the legend numbers appear correctly. However, in the second graph (), the legend does not display any numbers.traj1traj2

    Has anyone encountered this issue before or knows how to resolve it? Any help or suggestions would be greatly appreciated!

    Thank you in advance!

  • #2
    It looks like this is an issue specific to your data. I find it hard to imagine that people will be able to answer it without being able to reproduce your problem. Please include a data extract (as suggested in point #12 of the Statalist FAQ) using the dataex command. Importantly, please run the above commands on the extract and ensure the problem is reproduced in it.

    As a bonus: if the problem is not reproduced in the extract, that itself might give you a good clue to why this is happening.

    Furthermore: trajplot is not a command included in the standard Stata installation; it is a community-contributed command. There are no hits for trajplot if you use search within Stata. So it would be good for you to include instructions on how to install the command, for anyone to help you as well as for future forum readers. This is another part of the sort of advice for posting effective questions that you will find in the same FAQ section. Please do go through it.
    Last edited by Hemanshu Kumar; 05 Jun 2025, 22:50.

    Comment

    Working...
    X