Announcement

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

  • Scatter Plot Axis

    Hi,

    I have done a scatter plot where the X-axis starts from the negative of Y. How to bring X-axis to zero with the ticks? I have used the following codes:

    graph twoway (scatter ci perc_insured) (lfit ci perc_insured), legend(off) ytitle("Concentration Index", height(6)) ylab(, nogrid) graphregion(color(white)) plotregion( m(b=0) )
    Attached Files

  • #2
    This repeats https://www.statalist.org/forums/for...ve-to-positive

    We advise explicitly against this. See the detailed discussion at #1 in https://www.statalist.org/forums/help#adviceextras -- including

    1.2 Repeating the same question

    Please don't! Posting exactly the same question again is strongly discouraged and is unlikely to increase your chance of getting a response.

    We also explain in the FAQ Advice that .gph file attachments are deprecated. If that is surprising see https://www.statalist.org/forums/help#stata 12.4 and 12.5.

    The best solution here is my view is to add a line using

    Code:
    yline(0, lc(gs8) lw(medthick))
    where the extra suboptions are indicative that you can tune how this line is presented and certainly not definitive style specifications.

    Stata's rationale here is to avoid clutttering up the data region with axis title, labels and ticks. If you are determined to do that, MS Excel's default may be available to you.

    Otherwise see Scott Merryman's post at https://www.statalist.org/forums/for...-x-axis-to-y-0

    Comment


    • #3
      Sorry, I just felt my last was not too clear and I was not able to add my graph therefore tried simplifying. Sorry for this.
      Thank you for suggestion.

      Comment

      Working...
      X