search for: xyplot

Displaying 20 results from an estimated 1788 matches for "xyplot".

2008 Nov 10
4
Labeling points with xYplot
Hello R-Users, I am trying to label points on an xYplot. I can label the points, but then I lose the error bars. I suspect that I should be using panel.xYplot rather than panel.xyplot, but that didn't work either... Can anybody help me out? Example code is below. First xYplot has error bars, second tries to label the points and the bars disa...
2001 Jun 15
1
Pass-through of unevaluated arguments
Thanks to Deepayan Sarkar (lattice) and Paul Murrell (grid) I have nearly finished porting the Hmisc library's xYplot function to R. xYplot extends xyplot to allow for error bars, bands, and a few other features. In S-Plus I extended the Trellis function xyplot mainly by writing panel.xYplot. In R, xyplot contains a lot of code, so I implemented xYplot by calling xyplot from it. Things are working quite well bu...
2010 Feb 08
3
What is the equivalent function in R to xyplot in S?
Page 140 of MASS uses the function xyplot. But I don't find it in R. Is there a package that I should load to use xyplot. Or there is a function with a different name in R that does the same thing as xyplot in S. xyplot(Gas ~ Temp | Insul, whiteside, panel = function(x, y, ...) { panel.xyplot(x, y, ...) panel.lmline(x, y, ...) }, xlab...
2010 Jan 10
3
How to control spaces between axis, tick and label in xyplot or xYplot?
Dear R users, I encounter a problem regarding space control in xyplot. Basically, I want to control spaces between label, tick and axis. I remember there is a function called mgp in general plot. Is there a similar function for xyplot or xYplot? Below is my basic code: myplotkid<-xyplot(expected_offspringnumber~afr|decade,groups=SES,data1, auto.key=list(space=&quo...
2002 Apr 17
1
No output from (lattice) xyplot called within loops
Hello >From the following script I received a grafic output when I called: - xyplot.test( 'green3' ) - call.xyplot.test( 'blue3' ) I did NOT receive a grafic output when I called: - loop.xyplot.test( 'red3' ) What's the Problem? NB: I am using R 1.4.1 on Linux. --------- START OF SCRIPT ---------------- n <- 1000 x <- seq( 1, n ) y <- r...
2010 Mar 05
4
conditioning variable in panel.xyplot?
I wish to create a multipanel plot (map) from several datasets ("d" and "q" in the example below). I can condition the main xyplot statement on the "site" variable, but I don't know how to pass a conditioning variable to panel.xyplot plot so that the x-y coordinates from dataset q are only plotted at the appropriate site. library(lattice) d <- data.frame(site = c(rep("A",12), rep("B"...
2006 Dec 28
2
lattice xyplot: plot multiple lines with different colors
Hi everyone, I am using the lattice package to plot some simulation results, by using the function xyplot(). However, I cannot find a way to plot multiple lines within the same xyplot and to have each of the lines be drawn in a different color. This is what I am currently doing: xyplot(a + b + c ~ x, my_data, panel = panel.lines) but, of course, all lines are drawn in the same color. What I woul...
2003 Jan 20
2
Adding reference lines to xyplot
I'm trying to add a set of reference lines to a multipanel xyplot xyplot(y ~ x | Visit, panel = function(x, y, ...){ panel.xyplot(x, y, ...) abline(v = c(0.5, 1)) }) However, the reference lines are different for different visits. For example, for the first 2 visits, I'd like vertical lines at x = 0.5 and 1. For visits 3 and four, I'd like vertical...
2008 Sep 23
5
xyplot problem
Hi all, I am trying to produce some panels with dots in an X/Y plane where the diameter of the dots indicates a Z value (like e.g. earthquake maps where dot sizes indicate magnitudes and X/Y the location). This works fine with xyplot, e.g.: xyplot(1:3~1:3,cex=1:3,pch=16) However, when I do this with a panel variable, e.g.: x<-rep(1:3,5) y <- rep(1:3,5) sz <- rep(1:5,each=3) grp <- factor(rep(1:5,each=3)) xyplot(y~x | grp , cex=sz) then sz in the cex argument is not applied per group as I would expect. Same for...
2011 Jul 27
2
Creating a flat legend 'grob' for lattice xyplot
Hi, I want my xyplot legend to be flat, not tall, and there seems to be no way for xyplot's auto.key and key elements to do this: I tried many, many permutations of what I could find in the archives and reading the documentation. If there there's a way to make it flat, please tell me what the magic incantation...
2009 Oct 27
2
Print several xyplots to the same page in a pdf file
Hello everybody, I'm using the lattice package and the xyplot to make several graphs like below. However, I can just print the three grouped plots onto one page as I'm putting them into a pdf-file, which gives me a huge amount of pages... Is it possible to put them all, or at least more than one on the same page, for instance put three groups beside each...
2011 Jan 20
2
circular reference lines in splom
...llipse) set.seed(1) dat <- matrix(rnorm(300), ncol = 3) colnames(dat) <- c("X1", "X2", "X3") dat <- as.data.frame(dat) grps <- factor(rep(letters[1:4], 25)) panel.circ <- function(x, y, ...) { circ1 <- ellipse(diag(rep(1, 2)), t = 1) panel.xyplot(circ1[,1], circ1[,2], type = "l", lty = 2) circ2 <- ellipse(diag(rep(1, 2)), t = 2) panel.xyplot(circ2[,1], circ2[,2], type = "l", lty = 2) panel.xyplot(x, y) } xyplot(X2 ~ X1, data = dat,...
2010 Feb 14
2
xyplot, overlay two variables on one plot with group factors
All I want to overlay two variables on the same plot following their appropriate grouping. I have attempted to use subscripting in panel with panel.xyplot, but I can't get the grouping to follow into the panel...here is an example... dat<-data.frame( y= log(1:10), y2=10:19, x=1:10, grp = as.factor(1) ) dat2<-data.frame( y= log(10:19), y2= 20:29, x=1:10, grp = as.factor(c(2)) ) dat<-rbind(dat, dat2) # Here I plot both response var...
2008 Nov 11
1
Retrieving x argument name from a trellis object in R 2.8.0
Dear all, let consider the following function: Fun1 <- function() { library(lattice) plot1 <- 1:10~1:10 pl1 <- xyplot(plot1) return(pl1$call$x) } In R 2.5.0 (or older version) we have > Fun1() plot1 but starting from R 2.5.1 until the latest R 2.8.0 we obtain instead > Fun1() NULL because pl1$call seems to be equal to xyplot() without arguments. Something like xyplot(x=plot1) doesn?t work either....
2005 Jun 22
1
How to use expression in label with xYplot
...nom),CS137=seq(nom),TE129m=seq(nom)) if I use this function to create the labels : lab <- function(i) as.expression(bquote(italic(phantom(0)^{.(num[i])}*.(nom[i])))) label(df$GE78) <- lab(1) label(df$CS137) <- lab(2) label(df$TE129m) <- lab(3) all works fine when I use text and xyplot : plot(1:10) text(6,6,labels=label(df$CS137)) xyplot(CS137~TE129m,data=df,xlab=label(df$CS137),ylab=label(df$TE129m)) but xYplot doesn't work fine xYplot(CS137~TE129m,data=df) I have the message : Error in parse(file, n, text, prompt) : parse error if I change the lab function lab <-...
2004 Mar 26
1
xyplot inside a for loop problem
Hello everyone Could someone please explain me why are xyplot() calls inside a for loop unsuccessful? Calling plot() is OK but xyplot() just opens the graphics window and that is all. No error, no warning :-( The same xyplot() outside for loop works fine. --------------------------------------------------------- library(lattice) # OK: plot(1,2,type='p&...
2006 Jun 08
1
panel.abline and xyplot
Dear All, I am wondering on how to use the abline.xyplot with xyplot such that I will have different vertical lines for each panel. More sepcifically, suppose that the xyplot generates 4 panels defined by the combination of two binary variables: X_1 and X_2. i.e. xyplot(Y ~ Z | X_1*X_2, data = df) I want something like: abline(v = 5)...
2011 Jul 28
2
not working yet: Re: lattice overlay
Hi Dieter and R community: I tried both of these three versions with ylim as suggested, none work: I am getting only single (pch = 16) not overlayed (pch =3) everytime. *vs 1* require(lattice) xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris, panel= function(x, y, subscripts) { panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10)) panel.lmline(x, y, lty=4, col = "green4") panel.xyplot (iris$Petal.Length [subscripts], iris$Petal.Width[subscripts], pch= 3,...
2010 Dec 09
4
[lattice xyplot] Help needed in help in customizing the panel.abline() function
Hi folks, I need some help in customizing the abline() function to be used in a lattice plot. I have attached a reproducible example below. I need help in the following snippet: disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type = "h",lwd=2,panel = function(...) { panel.abline(v = 8, lty = 2) panel.xyplot(...) }) Is there a way I can give panel.abline() input from a which.max() function? Essentially I need the vertical line to be draw...
2008 Oct 23
2
I have an xyplot, I want to keep the format, but only show x or y
Good Morning, I am using xyplot to show two variables for a large number of subjects. Currently I am using xyplot(y~x|as.factor(ID), layout=c(7,9)) to give me a little plot of the x and y factors for each ID. The purpose of the plot is to let the PI quickly look through the data for irregularities. The good news is that the...