Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Friedrich Huebler <fhuebler@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
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 automated. . 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. http://www.stata.com/statalist/archive/2009-11/msg01095.html Friedrich On Sun, Mar 14, 2010 at 4:21 PM, Kit Baum <baum@bc.edu> wrote: > Easier to just > > . line price price, aspect(1) * * 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/