Displaying 20 results from an estimated 67 matches for "popviewport".
2008 Aug 06
1
grid layout scaling viewport width based solely on height
...of side
plots.
Thanks
Peter
require(grid)
grid.newpage()
lout1 <- grid.layout(nrow = 1, ncol = 2,
widths = unit(c(1, 1/10), c('null', 'snpc'))
)
pushViewport(viewport(layout = lout1, w = 0.8, h = 0.8))
pushViewport(viewport(layout.pos.col = 1))
grid.rect()
popViewport()
pushViewport(viewport(layout.pos.col = 2))
lout2 <- grid.layout(nrow = 10, ncol = 1,
heights = unit(1, 'snpc'))
pushViewport(viewport(layout = lout2))
for(i in seq(0, 1, length.out = 10)) {
pushViewport(viewport(y = i, width...
2007 Oct 19
1
Using grid graphics (hexbin) in pairs() plot problem
...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 with a second plot (analogous to what pairs()
would be doing) things are fine:
popViewport()
popViewport()
popViewport()
plot(10:100) # Second plot
vps <- baseViewports()
pushViewport(vps$inner)
pushViewport(vps$figure)
pushViewport(vps$plot)
grid.rect(gp=gpar(lwd=3, col="yellow"))
popViewport()
popViewport()...
2004 Jun 28
1
text length in grid
...,1), 1:5)))
for (i in 1:5) {
pushViewport(viewport(layout.pos.row = i, layout.pos.col = 1))
pushViewport(viewport(x = 0, width = i/5, height = .8, just = "left"))
grid.rect(gp = gpar(fill = rainbow(5)[i]))
grid.yaxis(main = F)
grid.text("I am some descriptive text.")
popViewport()
popViewport()
}
Unfortunately, the descriptive text overlaps with the axis for the red
rectangle! Is there any way, given the dimensions of some region on the grid
and the desired text, that I can fit this text to the region?
Sorry if I missed something in the documentation. I really did look...
2008 Mar 04
1
grid.layout?
...default.units = "cm")
pushViewport(viewport(layout = vpp))
for(i in seq(variates)){
for(j in seq(variates)){
pushViewport(viewport(layout = vpp, layout.pos.col = j,
layout.pos.row = i))
grid.rect(gp=gpar(lty='dashed'))
popViewport(1)
}
}
popViewport(1)
pushViewport(viewport(layout = vp, layout.pos.col = 1,
layout.pos.row = 1))
grid.rect(gp=gpar(col = "red", width = 3))
ylab.pos <- seq(variates)/length(variates)
ylab.pos <- ylab.pos - ylab.pos[1]/2
for(i in seq(variate...
2008 Jun 11
1
Problem when combining dotplot() and textplot() using grid
...uot;gr2",
"gr3", "gr4", "gr5"), 5), val=rnorm(25))
grid.newpage()
pushViewport(viewport(layout = grid.layout(1, 2)))
pushViewport(viewport(layout.pos.col=1, layout.pos.row=1))
p <- dotplot(f ~ val, groups=gr, xx, cex=1.7, pch=20)
print(p, newpage=FALSE)
popViewport(1)
pushViewport(viewport(layout.pos.col=2, layout.pos.row=1))
textplot(xx, show.rownames=FALSE)
popViewport(1)
Obviously, this does not work since textplot() seems to call plot.new
no matter what options are set with par().
My question: Is it possible to archieve my goal to plot the data.fra...
2012 Nov 22
1
How to read jpeg image with russian font in R?
...readJPEG("ArrowImage") # name of arrow
grid.newpage()
pushViewport(viewport(width=0.9, height=0.9))
pushViewport(viewport(yscale=c(0,0), xscale=c(0,1), x=0, y=0, width=0.15,
height=1.0, just=c("left", "bottom")))
grid.raster(a, y=unit(ypos.img, "native"))
popViewport()
popViewport()
dev.off()
Regards
--
View this message in context: http://r.789695.n4.nabble.com/How-to-read-jpeg-image-with-russian-font-in-R-tp4650417.html
Sent from the R help mailing list archive at Nabble.com.
2011 Oct 31
1
Help combining cell labelling and multiple mosaic plots
...1,2)))
pushViewport(viewport(layout.pos.col=1))
mosaic(.test, gp=shading_hsv, pop=FALSE, split_verticaL=FALSE, newpage=FALSE, labeling_args=list(offset_varnames=c(top=3), offset_labels=c(top=2)))
labeling_cells(text=round(prop.table(.test, 1), 2)*100, clip=FALSE)(.test)
popViewport()
pushViewport(viewport(layout.pos.col=2))
mosaic(.test1, gp=shading_hsv, newpage=FALSE,pop=FALSE, split_vertical=FALSE, labeling_args=list(offset_varnames=c(top=3), offset_labels=c(top=2)))
labeling_cells(text=round(prop.table(.test1, 1), 2)*100, clip=FALSE)(.test1)
popViewport(2)
************...
2009 Mar 21
1
Forestplot () box size question
...)
info[is.summary] <- 1
for (j in 1:nc) {
for (i in 1:nr) {
if (!is.null(labels[[j]][[i]])) {
pushViewport(viewport(layout.pos.row = i,
layout.pos.col = 2 *
j - 1))
grid.draw(labels[[j]][[i]])
popViewport()
}
}
}
pushViewport(viewport(layout.pos.col = 2 * nc + 1, xscale = xrange))
grid.lines(x = unit(zero, "native"), y = 0:1, gp = gpar(col = col$zero))
if (xlog) {
if (is.null(xticks)) {
ticks <- pretty(exp(xrange))...
2009 May 14
1
Problem with viewports, print.trellis and more/newpage
...it=c(2,2,2,4), more=T)#, newpage=isnewpage)
print(plots, split=c(1,3,2,4), more=T)#, newpage=isnewpage)
print(plots, split=c(2,3,2,4), more=T)#, newpage=isnewpage)
print(plots, split=c(1,4,2,4), more=T)#, newpage=isnewpage)
print(plots, split=c(2,4,2,4), more=F)#, newpage=isnewpage)
popViewport()
pushViewport(viewport(x=0,
y=0.95,
width=1,
height=0.05,
just=c(0,0)))
grid.text(label = i,
just = c("centre","centre"),
gp = gpar(font...
2007 Oct 24
1
Rotated viewports in Grid
...ull"),unit(1,"null")),heights=unit.c(unit(1,"null"),unit(2,"null")))
graph.view<-viewport(layout=graph.layout,name="root")
grid.newpage()
pushViewport(gap.view)
pushViewport(viewport(layout.pos.row=2,layout.pos.col=1))
print(xyplot(x~y),newpage=FALSE)
popViewport()
pushViewport(viewport(layout.pos.row=1,layout.pos.col=1))
print(densityplot(x),newpage=FALSE)
popViewport()
pushViewport(viewport(layout.pos.row=2,layout.pos.col=2,angle=270))
print(densityplot(y),newpage=FALSE) ### I Get the warning message here.
----------------------------------
--
Gustaf Ry...
2005 May 31
2
Problem going back to a viewport with gridBase
...2, name = "B"))
par(fig = gridFIG()); par(new = TRUE)
plot(1:100, col = "purple", pch = 18)
upViewport()
# go back to A and add horizontal grid lines
seekViewport("A")
par(fig = gridFIG())
abline(h=1:10, col = "red") #### THESE DO NOT GET DRAWN AS EXPECTED
popViewport()
# go back to B and add vertical grid lines
seekViewport("B")
par(fig = gridFIG())
abline(v=1:10, col = "red")
popViewport()
par(opar)
2005 May 31
2
Problem going back to a viewport with gridBase
...2, name = "B"))
par(fig = gridFIG()); par(new = TRUE)
plot(1:100, col = "purple", pch = 18)
upViewport()
# go back to A and add horizontal grid lines
seekViewport("A")
par(fig = gridFIG())
abline(h=1:10, col = "red") #### THESE DO NOT GET DRAWN AS EXPECTED
popViewport()
# go back to B and add vertical grid lines
seekViewport("B")
par(fig = gridFIG())
abline(v=1:10, col = "red")
popViewport()
par(opar)
2008 Aug 17
1
Making use of names of viewports (grid)
...k <- ppaste("Cube", k)
pushViewport(viewport(layout = vps, name = cube.k,
layout.pos.row = 1,
layout.pos.col = k))
grid.rect(gp = gpar(lty = "dashed", lwd = .1))
grid.text(cube.k, y = .9, gp = gpar(cex = .8))
popViewport()
}
## label first viewport in bottom row
pushViewport(viewport(layout = vps, name = "Cube5",
layout.pos.row = 3,
layout.pos.col = 1))
grid.rect(gp = gpar(lty = "dashed", lwd = .1))
grid.text("Cube5", y = .95, gp...
2006 Sep 05
4
Two submitted packages
...tmp <- data.frame(x=1:5, y=1:5, a=factor(c(1,1,1,1,1), levels=1:4))
xyplot(y ~ x,
data=tmp, ylim=c(1.5,4.5),
panel=function(x,y, ...) {
cpv <- current.viewport()
cpv$clip <- "off"
pushViewport(cpv)
panel.xyplot(x, y, ...)
popViewport()
})
## R version 2.4.0 Under development (unstable) (2006-08-14 r38872)
## gives the error message
Error in grid.Call.graphics("L_setviewport", pvp, TRUE) :
LOGICAL() can only be applied to a 'logical', not a 'character'
>
## Question 1. How do I pla...
2009 Apr 07
2
change default output size when using Sweave
...to be
standard size. I want the whole graphic to be 80mm of height only, just like
the viewport below.
<<fig=TRUE, echo=TRUE>>=
pushViewport(viewport(height = unit(80, "mm")))
grid.rect()
grid.text("I want this viewport to be the whole output size")
popViewport()
@
How can I make the graphic smaller (80mm of height) without having the white
margins at the top and bottom?
A lot of thanks in advance,
Mark
2011 Apr 28
2
gridBase Base Plot Positioning
...ddle of each rectangle ?
pdf("tmp.pdf", h = 6, w = 10)
pushViewport(plotViewport(c(5, 5, 4, 2)))
pushViewport(viewport(layout = grid.layout(4, 6)))
for(i in 1:5)
{
for(i2 in 1:4)
{
pushViewport(viewport(layout.pos.row = i2, layout.pos.col = i))
grid.rect()
popViewport()
}
}
pushViewport(viewport(layout.pos.col = 6))
plot.new()
par(plt = gridPLT(), new = TRUE)
randData <- lapply(1:4, function(x) sample(10, 10, TRUE))
boxplot(randData, horizontal = TRUE)
dev.off()
I'm using gridBase_0.4-3.
Thanks,
Dario.
--------------------------------------...
2006 Apr 06
2
key position in trellis plotting area
...<- list(key=keyArgs,draw=FALSE)
keyArgs$draw <- FALSE
key <- do.call("draw.key",drawKeyArgs)
vp1<-viewport(x=1,y=1,height=unit(1,"grobheight",key),width=unit(1,"grobwidt
h",key),just=c("right","top"))
pushViewport(vp1)
grid.draw(key)
popViewport()
If I embed the call to draw.key into the panel function, where presumably
the plotting area is the current viewport, then it works.
panel.test <- function(x,y,...){
panel.xyplot(x,y,...)
keyArgs <- list()
keyArgs <- list(points=list(pch=17,lwd=2,col=c("transparen...
2008 Sep 25
1
grid.newpage()
...,,names.arg=cf.names)
abline(h=0.3,lty=3,col="red"))
abline(h=0.1,lty=3,col="blue")
points(bplot,target$target/xi[nrow(xi),],pch=20) #!
,col=c(4,2,4,4,2,4,4,4,4,4,2,4)
text(bplot,target$target/xi[nrow(xi),],paste(target$target,"ha"),adj=c(-0.3,
0.5),cex=0.70,srt=90)
)
popViewport(1)
It fails to print ablines, points and text.
Any idea?
----------------------------------------------------------------------------
-------------------------------------------------
This electronic mail transmission including any attachment hereof, contains
information that is private and con...
2012 Feb 16
2
Defining a viewport scale in {Grid}
...grid.polygon(x=c(100,95,95,100)/100, y=c(100,100,95,95)/100, draw = T)
grid.polygon(x=c(50,70,70,50)/100, y=c(50,50,70,70)/100, draw = T)
grid.polygon(x=-c(10,10,40,40)/100, y=c(10,40,40,10)/100, draw = T)
#NEGATIVE X
grid.polygon(x=c(50,52,52,50)/100, y=-c(50,50,52,52)/100, draw = T)
#NEGATIVE Y
popViewport()
Thanks in advance.
--
View this message in context: http://r.789695.n4.nabble.com/Defining-a-viewport-scale-in-Grid-tp4393974p4393974.html
Sent from the R help mailing list archive at Nabble.com.
2009 Apr 16
3
segment between points on different plots
Hi,
I need to draw a line segment between two points on different plots in the
same multigraph.I've tried looking at the zoominplot function in plotrix but
havent understood much.any help is appreciated
~Aks
[[alternative HTML version deleted]]