Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: graph: how to draw 45 degree reference line


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   Re: st: graph: how to draw 45 degree reference line
Date   Mon, 15 Mar 2010 11:12:58 -0400

Nick's proposal can be modified to avoid having to specify the precise
coordinates of the line, an issue addressed by Dave earlier in this
thread. I assume that the line always start at the origin.

. sysuse auto
. sum weight, meanonly
. local max = r(max)
. sum price, meanonly
. if r(max) > `max' {
  local max = r(max)
  }
. scatter weight price || scatteri 0 0 `max' `max', recast(line) name(a)
. scatter price weight || scatteri 0 0 `max' `max', recast(line) name(b)

Friedrich

On Mon, Mar 15, 2010 at 8:06 AM, Nick Cox <[email protected]> wrote:
> [...]
>
> However, there is yet another way to do it:
>
> . sysuse auto
>
> . scatter weight price || scatteri 0 0 15000 15000, recast(line)
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index