Announcement

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

  • Graph editors, axis rules

    Hello everyone, could someone kindly help me with how to rescale the 'age' axis using the graph editor? I managed to change the axis scale values as desired, but I'm having trouble adjusting the graph area. I would like the 'age' axis to display only values within the range of 20-60. Thank you in advance!

    PS: additionally there is any command that could be used directly in the .do file for set the range of the "age axis" . my current command is the following:

    Code:
    twoway (line Pred_Mother2 age, sort lcolor(blue) lwidth(medium)) ///
           (line Pred_Father2 age, sort lcolor(red) lwidth(medium)) ///
           (line Pred_F_no_kids2 age, sort lcolor(green) lwidth(medium)) ///
           (line Pred_M_no_kids2 age, sort lcolor(orange) lwidth(medium)), ///
           legend(label(1 "Mothers") label(2 "Fathers") label(3 "Females(no kids)") label(4 "Males(no kids)"))
    Click image for larger version

Name:	graph.png
Views:	1
Size:	103.0 KB
ID:	1762601

    Last edited by Chiara Tasselli; 29 Aug 2024, 02:19.

  • #2
    I doubt that you can do anything of the kind with the Graph Editor. I'd go back to your original commands and specify if inrange(age, 20, 60)

    Don't ask for red and green on the same graph (please). Colours stc1 to stc4 would work well in your case. See also (e.g.)

    https://www.statalist.org/forums/for...ailable-on-ssc

    https://www.statalist.org/forums/for...scheme-stcolor

    Colours stc1 to stc4 are only available in Stata 18 up. But by longstanding convention, posters are assumed to be using the latest version unless they declare otherwise. And if that's not true, the two threads above provide alternatives.

    Comment


    • #3
      Thanks Nick Cox very helpful !!!

      Comment

      Working...
      X