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, statalist.org is already up and running.

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

 From Steve Samuels To statalist@hsphsun2.harvard.edu Subject Re: st: graph: how to draw 45 degree reference line Date Sun, 14 Mar 2010 15:01:49 -0400

```This variation looks like it will make the line truly a 45 degree line.

------CODE BEGINS-----
sysuse auto, clear
set obs 75
replace price = 0 in 75
line price price, xsize(4) ysize(4)
-----CODE ENDS

Steve
On Sun, Mar 14, 2010 at 2:51 PM, Martin Weiss <martin.weiss1@gmx.de> wrote:
>
> <>
>
>
> If ever you did want to extend the range with Nick`s solution, e.g. to
> include the origin:
>
>
>
> *************
> sysuse auto, clear
>
> set obs 75
> replace price = 0 in 75
>
> tw scatter weight price ||  /*
> */ line price price, sort
>
> *************
>
>
> HTH
> Martin
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Airey, David C
> Sent: Sonntag, 14. März 2010 19:06
> To: statalist@hsphsun2.harvard.edu
> Subject: RE: st: graph: how to draw 45 degree reference line
>
> .
>
> Ah, there's a good tip, and it avoids having to set the range with function
> y=x. Thank you.
>
> -Dave
>
>
>> Plotting a variable against itself is also sufficient.
>>
>> tw scatter weight price || line price price, sort
>>
>> Nick
>> n.j.cox@durham.ac.uk
>>
>> Philipp Rehm
>>
>> sysuse auto, clear
>> tw (scatter weight price) ///
>>   (function y=x, range(0 16000))
>>
>>
>> On 3/13/2010 3:13 PM, Sun, Yan (IFPRI) wrote:
>>
>> > I would like to draw a y=x reference line (which is 45 degree line)
>> for
>> > my twoway scatter plots.
>
> *
> *   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/
>
>
> *
> *   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/
>

--
Steven Samuels
sjsamuels@gmail.com
18 Cantine's Island
Saugerties NY 12477
USA
845-246-0774

*
*   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/
```