Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[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 <>
Subject   Re: st: graph: how to draw 45 degree reference line
Date   Mon, 15 Mar 2010 00:05:15 -0400

-line price price- is easy but depending on the resolution of the
display the line will not appear entirely straight. The appearance
also depends on how the data are sorted. -function- with the option
n(2) yields a cleaner graph. The setting of the range can be

. sysuse auto, clear
. sum price, meanonly
. local xmin = r(min)
. local xmax = r(max)
. twoway (scatter weight price) (function y=x, range(`xmin' `xmax')
n(2)), aspect(1)

A related discussion can be found in the archives.


On Sun, Mar 14, 2010 at 4:21 PM, Kit Baum <> wrote:
> Easier to just
> . line price price, aspect(1)
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index