Re: [R] Defining a viewport scale in {Grid}

2012-02-16 Thread baptiste auguie
The default units of polygonGrob are "npc", I think you want "native" instead. Try the following, library(grid) d = data.frame(x=rnorm(100, 10), y=rnorm(100, -100)) v = dataViewport(xData=d$x, yData=d$y) grid.points(d$x,d$y, default.units="native", vp=v) HTH, b. On 17 February 2012 02:47,

Re: [R] Defining a viewport scale in {Grid}

2012-02-16 Thread ilai
Read the Details section in ?viewport carefully. You are treating xscale/yscale as if they are xlim/ylim in base graphics. They are not. It may take some trial and error on your part to figure out how exactly this works, in general you are setting the size and location of each polygon relative to t

[R] Defining a viewport scale in {Grid}

2012-02-16 Thread geotheory
Am just feeling my way into the grid library, and cannot figure out how to define the plot limits. 3/5 of the example polygons below plot in the default 0-1 range viewport. But when I try to redefine the viewport the polygons plot in the same places. I also get the same result without employing