RE: [R] Scatterplot axes

2003-12-10 Thread Pfaff, Bernhard
 Please, could someone help me figure out what seems to be a 
 very simple
 problem (and is still taking me hours...).
 I want to draw a simple scatterplot but with 'equal' axes, 
 i.e. I want both
 axes to go from -3 to 3. Values for x lie between -2 and 0.5, 
 values for y

Hello Ellen,

how about:

(x - seq(-2, 0.5, length=10))
(y - seq(-3, 3, length=10))
plot(y~x, xlim=c(-3,3), ylim=c(-3, 3))

HTH,
Bernhard



 between -2.2 and 3. I have tried 'usr' and 'eqscplot' and a few other
 options, but it doesn't give me the desired result.
 Many thanks!!!
 Ellen
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 



The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Scatterplot axes

2003-12-10 Thread Giovanni Petris

Have you tried specifying xlim and ylim? See ?par.

-- 

 __
[  ]
[ Giovanni Petris [EMAIL PROTECTED] ]
[ Department of Mathematical Sciences  ]
[ University of Arkansas - Fayetteville, AR 72701  ]
[ Ph: (479) 575-6324, 575-8630 (fax)   ]
[ http://definetti.uark.edu/~gpetris/  ]
[__]

 Date: Wed, 10 Dec 2003 14:46:49 +0100
 From: Ellen Kalmbach [EMAIL PROTECTED]
 Sender: [EMAIL PROTECTED]
 Precedence: list
 
 Please, could someone help me figure out what seems to be a very simple
 problem (and is still taking me hours...).
 I want to draw a simple scatterplot but with 'equal' axes, i.e. I want both
 axes to go from -3 to 3. Values for x lie between -2 and 0.5, values for y
 between -2.2 and 3. I have tried 'usr' and 'eqscplot' and a few other
 options, but it doesn't give me the desired result.
 Many thanks!!!
 Ellen
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Scatterplot axes

2003-12-10 Thread Thomas W Blackwell
Ellen  -

plot(my.x.vector, my.y.vector, xlim=c(-3,3), ylim=c(-3,3))

It's the named arguments xlim and ylim that you were looking for.
I frequently set them as  xlim = 3 * c(-1,1), ylim = 3 * c(-1,1)
so that I can change the range by editing just one number rather
than two.  For an added fillip, try adding the argument  asp=1.
This will extend the range of one axis or the other by just
enough so that the graphical scale is the same on both axes,
that is, a one unit increase is the same number of millimeters
on the horizontal and the vertical axes.  It's very cool.  It
does, completely automatically, what I used to do painstakingly
by trial and error, tinkering with the width of the top and side
margins, until the graphical scales were equal.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Wed, 10 Dec 2003, Ellen Kalmbach wrote:

 Please, could someone help me figure out what seems to be a very simple
 problem (and is still taking me hours...).
 I want to draw a simple scatterplot but with 'equal' axes, i.e. I want both
 axes to go from -3 to 3. Values for x lie between -2 and 0.5, values for y
 between -2.2 and 3. I have tried 'usr' and 'eqscplot' and a few other
 options, but it doesn't give me the desired result.
 Many thanks!!!
 Ellen

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help