search for: lpoints

Displaying 20 results from an estimated 22 matches for "lpoints".

Did you mean: points
2007 Mar 22
2
unexpected behavior of trellis calls inside a user-defined function
...rf) # OK, get the expected figure result ## now .. what if we add points to the plot? levelplot(Sepal.Width ~ Sepal.Length * Petal.Length, predSurf, main = "Produced at command line, Take 2") trellis.focus("panel", 1, 1) # address the correct part of the figure lpoints(6,4,pch = 19, cex = 2) # a point appears in correct location # I get what I expect ## any crosstalk from adjacent command line invocations? no levelplot(Sepal.Width ~ Sepal.Length * Petal.Length, predSurf, main = "Produced at command line, Take 3") trellis.focus("panel...
2003 Aug 20
1
Filled triangles in lattice graphics?
Dear R users, I can get a filled triangle pointing upwards by specifying pch=17 in xyplot or lpoints, but how do I get a filled triangle that points downwards? In the standard plot function it's possible to use plot(x,y,pch=25,bg="black"), but bg= doesn't seem to work with lattice and lpoints. Thanks, Hans Gardfjell Ecology and Environmental Science Ume? University, Sweden
2009 Dec 20
1
How to put text outside an xyplot?
...ay=function(l) gray(seq(0.2,0.8,length=l)) colors=level.colors(data[1:10,2],at=do.breaks(c(1,10),10),col.regions=mygray) colorvec=colors[1:10] #trellis.device(postscript,color=F,horizontal=F,onefile=F) xyplot(data[,2]~data[,1],aspect=1, panel=function(...){ panel.xyplot(...,type="n") lpoints(data[,1],data[,2],pch=1,col=colorvec) grid.text("text to the right of the color key",1.2,0.5,rot=90)#does not work. }, xlab="x",ylab="y", legend=list(right=list(fun=draw.colorkey,args=list(key=list(col=mygray(10),at=1:10)))) ) #dev.off()
2004 Aug 31
1
add single contour line to levelplot
..., with no default Any tips on how to fix this are greatly appreciated! Ian Jonsen levelplot(dens~nu*sigma,data=tsurflikB,at=c(-20,-10,-5,-4,-3,-2,-1), col.regions=gray(seq(0.5,0.9,length=14)),region=T,colorkey=F,aspect=1, panel=function(x,y,z,...){ panel.levelplot(x=x,y=y,z=z,...) lpoints(x[z==0],y[z==0],pch=16,cex=0.5) panel.levelplot(z~x*y,at=-3,contour=T,aspect=1) } ) _______________________________ Ian Jonsen, Postdoctoral Fellow Dept Biology, Dalhousie University, Halifax, NS, CAN Phone: 902 494 3910; Fax: 902 494 3736 jonsen at mathstat.dal.ca
2004 Aug 19
1
Clipping of display in Lattice graphics
...If you run this you will see a datapoint and line extend into the pink area. However, if xyplot is used, it doesn't extend past its borders: xyplot(y~x, xlim=c(0,1), ylim=c(0,1), type=c("p","l")) From what I understand so far: xyplot calls panel.xyplot panel.xyplot calls lpoints and llines neither lpoints nor llines do much except call xy.coords and then call lplot.xy lplot.xy calls grid.points and grid.lines Where in this code does the clipping occur? I'm quite baffled really. Thank you for considering this, Matthew
2009 Apr 30
1
Hmisc: xYplot and panel.lines
...package, I tried to create an xYplot (single panel only) and was confused to find that I could not add anything else to the plot (abline, lines, etc.). Thankfully, [1] points out panel functions. This works as expected for panel.abline, but as soon as I'm using panel.lines (or llines or lpoints) from the "lattice" package (version 0.17-17 with R 2.8.1), it seems that it is not using the coordinate system that the original plot used, i.e. the graph does not work at all. My code: pfunc <- function(x,y,...) { panel.xYplot(x, y, ...) panel.abline(h=4.0, col = "g...
2010 Jun 08
1
add one point to contourplot()
Hi All, I want to add one point to contourplot().  I used contourplot() in my code like contourplot(z ~ a + b |c, data) I understand there is plot.axes argument for filled.contour(), but it  did not work for my code. I also tried plot() and text() for contourplot(), but got this error: "plot.new has not been called yet" Any suggestion for adding a point in contourplot()? Thank you very
2010 Apr 12
1
lattice garphs: combining multiple scatterplots and adding legend
...type=c('l'),col="black",xlab="",ylab="", ???ylim=c(-55,80),xlim=c(-170,175),pch=20,cex=0.2, ???auto.key = list(x=0,y=0,text=c('test1','test2','test3'))) print(all,position=c(0,0,1,.7),more=T) #add points trellis.focus(highlight=FALSE) lpoints(data_x,data_y,pch=20,col=cols) update(all,auto.key = list(x=0,y=0,text=c('test1','test2','test3'))) The plots are produced correctly, but the legend is still missing. Could anyone give me some hints? There is probably a much more elegant way how to combine the two plots bu...
2001 Nov 29
2
text in qqmath
Hello, I can't seem to make qqmath plot text. v <- rnorm(8) qqmath(~v) # this is ok, but qqmath(~v, panel=function(x, y) { points(x, y) text(0, 0, 'print me', cex=2)}) isn't ok. The axis frame is printed properly (ie, as in qqmath(~v)), but neither 'print me' nor the points show up on the graph. I can, however, see the upper half of the word 'me' in the
2011 Aug 22
1
lattice to ggplot2 conversion help
...ne = list(col = "grey", lty = 1)) # print is needed when you source() the file print(xyplot(height ~ dist | geology, data = tmp, groups = species, layout = c(2,2), panel = function(x, y, type, ...) { panel.superpose(x, y, type="l", ...) lpoints(x, y, pch=16, col="white", cex=2) panel.superpose(x, y, type="p",...) }, par.settings = sp, auto.key = list(columns = 2, lines = TRUE))) I will be very happy if someone can please explain me how to do it in ggplot2 as it will be great help. C...
2007 Aug 14
2
Using sunflowerplot to add points in a xyplot panel
Hi, I use panel.points to add points to a xyplot graphic. But I like to use the sunflowerplot to plot my points because this is very superimposed. It is possible to use this? I try but it dont work directly. It may be need to put this function inside a panel.??? Thanks Ronaldo -- Where there's a will, there's a relative. -- > Prof. Ronaldo Reis J?nior | .''`.
2007 Dec 25
1
both lines and plot characters in a lattice plot key
...from light gray and ending with a dark gray. Thanks very much in advance! Jan library(lattice) x=c(1,2,3,4,5) y=c(5,4,3,2,1) symbolvec=c(3,3,3,1,3) colorseq=seq(0.25,0.88,length=5) colors=gray(colorseq) colorvec=colors xyplot(y~x, panel=function(...){ panel.xyplot(...,type="n") lpoints(x,y,pch=symbolvec,col=colorvec) }, key=list(x=0.2,y=0.2,lines=list(lty=c(0,0,1)),points=list(pch=c (1,3,26)),text=list(c("key 1","key 2","key 3")),align=T,transparent=T))
2008 Aug 25
1
lattice : using both strip and strip.left
...strip=strip.custom(which.given=1), > strip.left=strip.custom(which.given=2) , > panel = function(x, y, ...) { > panel.fill(grey(0.95), border="white") > panel.grid(h=-1, v=-1, col="white", col.line="white", lty=1, > lwd=2.5) > lpoints(x, y, pch=16, col=1:2, cex=1) > }, > key = simpleKey(levels(df$variable), space = "right")) > > print(p2) Several things resist me, I welcome any input, - with two levels of facetting, i often find convenient to layout the graphs in a 2d, rectangular matrix, and ha...
2006 Nov 24
2
low-variance warning in lmer
...)) box() points(jitter(rvec),rfrac,col=X[,"warn"]+1) curve(1*x,add=TRUE,lwd=2) print(densityplot(~rfrac,groups=rvec,from=0,to=0.9, panel=function(...) { panel.densityplot(...) cols <- trellis.par.get("superpose.line")$col lpoints(unique(rvec),rep(8,length(rvec)),type="h", col=cols[1:length(rvec)]) })) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 254 bytes Desc: OpenPGP digital signature Ur...
2010 Mar 31
2
lattice: how to add points to the plot generated by levelplot()?
I am using levelplot() function from pkg:lattice and I want to add some points to the plot generated by levelplot() similarly as in basic R graphic sequence: plot(...); points(...), but it does not work. I was reading documentation for lattice, but so far without much success. I would very much appreciate some tips. Best regards, Ryszard
2004 May 02
1
contourplot, xyplot, aspect ratio, mfrow
Hi, I am gradually moving from the classical R plot functions to the library Lattice I have some questions about contourplot () and its arguments: 1/ I am working on geographical coordinates which makes necessary that the X (longitude) and Y (latitude) units be represented with the same distance on screen. This was obtained in the classical R plots with plot.default(x,y, asp=1,...) and then
2003 Jul 14
2
Multipanel weighted regression lines.
Dear R-users, I am trying to create a multipanel scatter plot which displays weighted regression lines for each subgroup. I am having diffuculty figuring out how the Trellis multipanel plotting functions work, in general. Does someone know where there are some beginners examples on how to create and use panel.xxx functions in conjunction with the xyplot functions? Back to the matter at hand
2001 Sep 21
2
new versions of grid and lattice
...code to R is the unusability of the base R functions like lines and points inside panel functions. To help make the changes more transparently, lattice now includes several wrappers around grid functions that provide an API similar to the corresponding base R functions. The list currently includes lpoints, llines, ltext and lsegments. Using Lattice and base R graphics concurrently ============================================== Grid graphics normally do not mix with usual R graphics. However, end-users typically might want to use lattice functions concurrently with traditional R graphics. To allow...
2001 Sep 21
2
new versions of grid and lattice
...code to R is the unusability of the base R functions like lines and points inside panel functions. To help make the changes more transparently, lattice now includes several wrappers around grid functions that provide an API similar to the corresponding base R functions. The list currently includes lpoints, llines, ltext and lsegments. Using Lattice and base R graphics concurrently ============================================== Grid graphics normally do not mix with usual R graphics. However, end-users typically might want to use lattice functions concurrently with traditional R graphics. To allow...
2002 Apr 08
2
user coordinates and rug plots in lattice graphics
Dear R list members, I'd like to produce rug plots at the bottom of panels in a trellis display (using the lattice package), but par("usr") doesn't return user coordinates for panels, and consequently rug fails, as the following example (suggested to me by Georges Monette) illustrates: > x <- rnorm(50) > y <- rnorm(50) > f <-