Announcement

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

  • How to modify the width of x- and y-axis are the same?

    Hi everyone,

    In my example, delta1 = 0.05 (y-axis) has the width is larger than delta 2 = 0.2 (x-axis). Now, I want the width of delta 1 and delta 2 are the same.

    Any help is greatly appreciated.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(month mean_lnpr change_spr)
    456             .           .
    457   -.012707757  .019999966
    458    .010914537   -.0599999
    459   -.031224454 -.030000135
    460   -.016030535 -.019999966
    461   -.019678574  .019999966
    462    -.04870307 -.009999797
    463    -.10341889    .0599999
    464     .05016299   .24999976
    465   -.021242706 3.72529e-07
    466    .003762972           .
    467    -.00563306  -.09000003
    468   -.021960266         .11
    469    -.03802032  -.03999993
    470   -.023665084   -.0400003
    471    .067306496  .019999966
    472      .0206784   -.0599999
    473   .0004590258   -.2700001
    474    -.02653531  -.01000017
    475    -.03900745   -.1899995
    476     -.0344338    .1000002
    477   -.033056814  -.14999993
    478   -.018032696   .20999946
    479   -.003666928 -.009999797
    480     -.0106339  -.07000007
    481    -.01839246         .11
    482    .004777093  .009999424
    483       .030778   .04000068
    484 -5.291117e-06  -.21000057
    485    .008179313   .29000044
    486     .04986938   .05999953
    487    -.03466524   .09000003
    488    .007029713   .07000044
    489    -.02866596   .03999993
    490   -.013984645   .02999976
    491    .034782033           .
    end
    format %tmMonth_CCYY month
    Code:
    twoway (scatter mean_lnpr change_spr,msymbol(S) msize(small)) ///
    (lfit mean_lnpr change_spr,lpattern(shortdash_dot)) ///
    (qfit mean_lnpr change_spr,lpattern(dash)), ///
    ytitle(Monthly Equity Returns ) xtitle(Monthly Changes in the Default Spread) graphregion(color(white)) ///
    legend(label(2 "Linear Prediction Line") label(3 "Quadratic Prediction Line") order(2 3))
    Click image for larger version

Name:	Screenshot 2019-03-25 13.38.45.png
Views:	1
Size:	56.8 KB
ID:	1489950


    --------------------
    (Stata 15.1 MP)

  • #2
    You can control

    Code:
    xscale()
    
    yscale()
    
    xsize()
    
    ysize() 
    
    aspect()

    Comment

    Working...
    X