Announcement

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

  • xlabel in xaxis(2)

    The xlabel failed to display correctly for xaxis(2) in scatter. The issue can be replicated via the codes below. Have I missed anything, or is it a known issue to be updated? Please help.

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int(id visit_date) float(x y)
    1067 19478 19478         .
    1067 19541 19541         2
    1067 19604 19604       1.5
    1067 19674 19674 1.3214285
    1067 19744 19744  1.763158
    1067 19814 19814    1.8125
    1067 19877 19877 1.6842105
    1067 20052 20052 2.0853658
    1071 19464 19464         .
    1071 19534 19534         4
    1071 19597 19597 2.1052632
    1071 19695 19695 2.4848485
    1071 19786 19786  3.478261
    1071 19849 19849 4.0545454
    1071 19940 19940 4.0441175
    1071 20003 20003  3.922078
    end
    format %tdDD/NN/CCYY visit_date
    ------------------ copy up to and including the previous line ------------------

    l id visit_date x y if id==1067 | id==1071,clean

    tw sc y x if id==1067, c(l) yaxis(1 ) xaxis(1 ) ///
    xlabel(19541 19604 19674 19744 19814 19877 20052, ///
    format("%tdDD/NN/CCYY") angle(45) labsize(vsmall)) ///
    ysc(r(1 4)) ylab(1(.5)4) ///
    || sc y x if id==1071, c(l) yaxis(1) xaxis(2) lcolor(blue) mcolor(blue) ///
    xlabel( 19534 19597 19695 19786 19849 19940 20003, ///
    format("%tdDD/NN/CCYY") angle(45) ) legend(off) sav(g3,replace)

    tw sc y x if id==1067, c(l) ///
    xlabel(19541 19604 19674 19744 19814 19877 20052, ///
    format("%tdDD/NN/CCYY") angle(45) ) ///
    ysc(r(1 4)) ylab(1(.5)4) sav(g1,replace)

    sc y x if id==1071, c(l) lcolor(blue) mcolor(blue) ///
    xlabel( 19534 19597 19695 19786 19849 19940 20003, ///
    format("%tdDD/NN/CCYY") angle(45) ) ///
    ysc(r(1 4)) ylab(1(.5)4) sav(g2,replace)

    graph combine g1.gph g2.gph g3.gph, c(2) xsize(26) ysize(20)
    * the x-axis(2) not shown appropriately

    Thank you!



  • #2
    Dear friends/helpers, I am terribly sorry. The problem has been kindly fixed by Andrew Musau. It was because of my own mistakes, not a Stata issue. Really appreciate the help! Thank you, Andrew.

    Comment


    • #3
      Thanks for the gracious closure. If anyone is interested in the solution, please follow https://www.statalist.org/forums/for...twoway-scatter

      Comment

      Working...
      X