# [R] Problem with plotting size/location on variation of star/segment plot

From: Shelby Berkowitz <berkowi4_at_msu.edu>
Date: Sun 06 Mar 2005 - 03:42:02 EST

I'm running into a problem with some modified segment plots I've coded using stars(). What I am trying to do is superimpose two series of data along with radial axes markers in a 2x2 graphics frame. This is working fine now, except for the hitch: my plots overfill the frame and are not centered within it (on my runs they always end up looking like they've been budged up and to the left). They're also a little warped-looking (more oval than perfectly round).

At this point, I'm completely stumped. Can someone please point me towards what I might be doing wrong here? Any and all advice will be most humbly appreciated!
BTW, I'm running R 2.00 on Windows XP, all packages updated.

Example version of my code is pasted below (the loop is for example purposes only):

##begin sample code
par(mfrow=c(2,2))
for (i in 1:4) {

## generate sample data for plot:

```	a<- sample(c(20:70)*.01,18)
testA <-
as.data.frame(rbind(a,a+((1-a)*sample(c(1:10)*.1,18,replace=T))))

## open new plot space

plot.new()

## plot data series:

stars(testA[2,], locations=0:1,full = TRUE, scale = F,
stars(testA[1,], locations=0:1,full = TRUE, scale = F,
majgrid <- matrix(rep((c(1:10)*.1),ncol(testA)),nrow=10,byrow=F)

## generate and plot radar grid:

mingrid <-
matrix(rep((c(1:10)*.1-.05),ncol(testA)),nrow=10,byrow=F)
stars(majgrid, locations=0:1, scale=F, draw.segments = TRUE,
stars(mingrid, locations=0:1, scale=F, draw.segments = TRUE,
```
par(mfrow=c(1,1))
##end sample code

Thank you,

Shelby

Shelby L. Berkowitz
Ecological-Community Psychology
and Institute for Health Care Studies

Michigan State University
berkowi4@msu.edu

R-help@stat.math.ethz.ch mailing list