Announcement

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

  • Reverse the scale of yaxis(1) and yaxis(2)

    Hi everyone,

    I'm planning to use twoway to draft a plot. We have two Y axis, one is Z-score (ranged from 0 to 3) and one is precision (ranged from 0 to 1.5).

    Now I want to reverse the scale of the two Y axis, say, the top of the Y will be 0 and the bottem will be 3 (axis 1) or 1.5 (axis 2). However, I found I can only force the first Y axis with the scale reversed, while I cannot make the 2nd Y axis to be reversed.

    Here is my code:
    Code:
    twoway(line Z es, yaxis(1) ysc(rev)clcolor(black black) clpat(dash dash)) (line _seES es, yaxis(2) ysc(rev) clcolor(black black) clpat(dash dash))
    Is there any method to reverse the scale of yaxis(2) ?

    Thanks
    Chang

  • #2
    This may help:



    Code:
    gen _seEs2 = 2 * _seEs  
     twoway  line Z  _seEs2 es, yaxis(1 2) ysc(rev) clcolor(black black) clpat(dash dash) yla(0/3, axis(1)) yla(0 1 "0.5" 2 "1" 3 "1.5", axis(2))

    Comment

    Working...
    X