Announcement

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

  • Keeping axis range consistent

    I have generated 10 scatterplots with a line of best fit in each.
    But it seems that each scatterplot has a slightly different range of values along the y-axis (15.0-20.0)
    I would like y-axis to be standardized at a range of (16.0-19.0)

    Is there something I should add to my code for scatterplots to do this?

    Thanks!

    My code is the following:
    binscatter iopcc_out bmi3_out, by(sex) nquantiles(10) linetype(connect) rule 16(0.25)18

    and I believe the bold part is incorrect


    Last edited by Alan Jeddi; 04 Jul 2018, 13:36.

  • #2
    Alan,

    You need the ylabel option. Here's an example with the auto data.

    Code:
    sysuse auto, clear
    
    tw sc price mpg if foreign==0, ylabel(0(5000)20000) name(domestic, replace)
    tw sc price mpg if foreign==1, ylabel(0(5000)20000) name(foreign, replace)

    Comment

    Working...
    X