search for: baseviewport

Displaying 14 results from an estimated 14 matches for "baseviewport".

Did you mean: baseviewports
2004 Sep 23
1
Gridbase basic question
...fixed to 0.5 in native coordinates. I can't quite get the code right to do this. Can anyone give me a quick example of how to do this? I looked the gridBase index and the tutorial (from R-news?) but just haven't gotten it down yet. > plot(1:10,1:10) > par(new=T);vps <- baseViewports() > pushViewport(vps$inner,vps$figure,vps$plot) viewport[GRID.VP.28] > pushViewport(viewport(x=unit(1,"native"),y=unit(2,"native"))) viewport[GRID.VP.29] > grid.rect(height=unit(0.5,"native"),width=unit(1.5,"native"),just='botto m') T...
2008 Dec 05
1
Trouble with gridBase and inset plots
...1.24e8,cex=1.2,"Residence time for") text(1.3,1.21e8,cex=1.2,"a 6.5m long transfer tube") arrows(1.1, 7.7e7, time[21], 7.7e7, length = 0.,lwd=2) arrows( time[21], 7.7e7, time[21], tot_num_150[21]/1e6, length = 0.15,lwd=2) par( mar = c(0.,0., 0., 0.) ) #1st inset vp <- baseViewports() pushViewport(vp$inner,vp$figure,vp$plot) pushViewport(viewport(x=-0.0,y=1.04,width=.4,height=.4,just=c(0,1))) par(fig=gridPLT(),new=F) #grid.rect(gp=gpar(lwd=0,col="red")) plot(D_mean,data_150[1, ]/log_factor*log(10)/1e6,"l", pch=1,col="black"...
2008 Sep 01
1
npc to native coordinates for xyplot
...en I pass the parameter default.units="native" to grid.circle, as suggested in this post:http://tolstoy.newcastle.edu.au/R/e4/help/08/03/5534.html. I also tried replicating the code in Paul Murrell's GridBase documentation, but to no avail: xyplot(y ~ x, groups=pt, data=dt) vps <- baseViewports() pushViewport(vps$inner, vps$figure, vps$plot) grid.circle(x=unit(-6,"native"), y=unit(-8,"native"), r=1) popViewport(3) Is there some other parameter or command that will convert the grid.circle() NPC coordinates to the native coordinates within my xyplot graph, and not the...
2007 Oct 19
1
Using grid graphics (hexbin) in pairs() plot problem
...ehow lost. The gridBase documentation contains a sample which has a normal ("base") plot with two columns, and some code to use grid commands to paint rectangles. library(grid) library(gridBase) par(oma=rep(1, 4), mfrow=c(1, 2), xpd=NA) plot(1:10) vps <- baseViewports() pushViewport(vps$inner) grid.rect(gp=gpar(lwd=3, col="red")) pushViewport(vps$figure) grid.rect(gp=gpar(lwd=3, col="green")) pushViewport(vps$plot) grid.rect(gp=gpar(lwd=3, col="blue")) grid.points(1:10, 10:1) if I continue...
2006 Apr 06
2
key position in trellis plotting area
...1:10),par.setting=list(background="white "),col="black",panel=panel.test) But, I don't want to write panel functions that are specific to the key. I'd like to draw the plot, access the plotting area viewport, push it, and add the key. Something may be possible with baseViewports, but I can't get that to work properly with a 1 x 1 lattice plot, and the relative position of the key changes when the device is rescaled. Is there an easy way to do this in the initial call to xyplot? My read of the documentation is that a key may be positioned in the npc coordinates of the...
2004 Jul 21
2
RE: Comparison of correlation coefficients - Details
Dear all I apologize for cross-posting, but first it is accepted custom to thank the repliers and give a summary, and second I have still the feeling that this problem might be a general statistical problem and not necessarily related to microarrays only, but I might be wrong. First, I want to thank Robert Gentleman, Mark Kimpel and Mark Reiners for their kind replies. Robert Gentleman kindly
2005 May 31
2
Problem going back to a viewport with gridBase
...t draws the horizontal lines as if its relative to B's coordinates rather than restablishing A's coordinates. As a result the horizontal lines are drawn near the bottom of the graph instead of at the correct heights. Try running the code below to see what I mean. I have also tried to use baseViewports with this but did not have any success. How do I modify this example so that the horizontal red lines come out at the appropriate levels? Note that this is just an example and in the future I will want to have multiple viewports each with a base plot and add arbitrary additional line or point...
2005 May 31
2
Problem going back to a viewport with gridBase
...t draws the horizontal lines as if its relative to B's coordinates rather than restablishing A's coordinates. As a result the horizontal lines are drawn near the bottom of the graph instead of at the correct heights. Try running the code below to see what I mean. I have also tried to use baseViewports with this but did not have any success. How do I modify this example so that the horizontal red lines come out at the appropriate levels? Note that this is just an example and in the future I will want to have multiple viewports each with a base plot and add arbitrary additional line or point...
2005 Feb 13
1
Transparent Pie Charts
Hi again! I put this question in another topics post before but I fear it might drown there. Is it possible to have transparent / alpha blended colors for pie charts? I am using the pies in a map of pies and those pies are sometimes overlapping so it would be great to see if another pie lies beneath. Thanks, Werner
2008 Sep 20
0
gridBase and layout
...), > heights = c(1, 0.5)) > > oldpar <- par(no.readonly = TRUE) > par(mar = c(0, 3.5, 0, 1), pty = "m", xpd = F, mgp = c(1.8, 0.5, 0)) > # > # top graph > # > plot(x, y, xaxt="n", ylab="label1") > axis(1, lab=F) > > vps <- baseViewports() > pushViewport(vps$inner, vps$figure, vps$plot) > pushViewport(viewport(x = unit(-1.8, "native"), y = unit(0.7, > "native"), > width = unit(1.5, "native"), height = unit(0.6, "native")) ) > > par(plt = gridPLT(), new = TRUE, mgp...
2011 Feb 25
1
question about "srt" argument in text() plotting function
Just wondering: it appears that "srt" does not accept a vector of values, just a single value. I ended up using tapply() as the following code snippet shows, so it's not a major problem. I was justa little surprised that this argument (srt) differs from things like "labels," "lty," "col," and so on, all of which accept (and recycle as needed
2004 Nov 22
4
How to correct this
Hi there, I tried to add a few circles on an existing figure using the following codes grid.circle(x=0.5, y=0.5, r=0.1, draw=TRUE, gp=gpar(col=5)) grid.circle(x=0.5, y=0.5, r=0.3, draw=TRUE, gp=gpar(col=5)) grid.circle(x=0.5, y=0.5, r=0.5, draw=TRUE, gp=gpar(col=5)) points(0.5, 0.5, col = 5) # centre of the circle , but all circles moved away from the centre. Could we do any
2007 Aug 28
2
Limiting size of pairs plots
Dear R-users, I would like to add a legend at the bottom of pairs plots (it's my first use of this function). With the plot function, I usually add some additional space at the bottom when I define the size of the graphical device (using mar); grid functions then allows me to draw my legend as I want. Unfortunatley, this technique does not seem to work with the pairs function as the
2007 Sep 02
2
Different behavior of mtext
Dear R Users, I am quite surprised to see that mtext gives different results when it is used with 'pairs' and with "plot'. In the two following codes, it seems that the 'at' argument in mtext doesn't consider the same unit system. I would appreciate your comments on this issue. Sebastien ##### Pairs mydata<-data.frame(x=1:10,y=1:10) par(cex.main=1,