search for: xyplot

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

2008 Nov 10
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...
2010 Mar 05
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
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...
2011 Jul 27
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...
2010 Feb 14
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 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...
2005 Jun 22
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 <-...
2006 Jun 08
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 Jan 31
align xyplot
Dear R users, I'm using xyplot to obtain a graph about a correlation x~y for different years (a categoric variable). The program dispose automatically the graphs in this way: 2010 2007 2008 2009 2004 2005 2006 2001 2002 2003 1998 1999 2000 Which code should I use to obtain this sequance of graphs? 1998 1999 2000 2001 2002 2...
2007 Oct 09
lattice/xyplot: horizontal y-axis labels with scales(relation="free")
I would like to create an xyplot with varying y-axis limits and horizontal labels at the y-axis tickmarks. The following does not seem to work, although I think it should, going by the documentation for par. R version 2.5.1, Windows XP Prof. Thanks for a clue. Andreas Krause library(lattice) # axis labels for y-axis are horiz...
2010 Sep 03
define colors for groups in lattice xyplot
...uot;A","B","C"),each=5),times=3 )), location= factor(rep (paste("LOC",1:3),each=15)), color = rep (rep (c("red","green","blue"),each=5),times=3 ), result = rnorm (45)) library(lattice) xyplot( result ~ time | location, data=dataset,groups=genotype,pch=19, type="b") xyplot( result ~ time | location, data=dataset,groups=genotype, fill.color = dataset$color, panel = function(x, y,fill.color,...,subscripts) { fill =
2009 Feb 20
adding a reference line to an xyplot
Hi, I want to add a dashed vertical line to a number of xyplots. Here is a simple script of the type of plot I have but then I want to add a reference line to 1995 on each of the panels. I have tried panel.abline and other suggestions on the forum but can't get it to work. plot<-rep(letters[1:3],each=10) year<-rep(1991:2000,times=3) matter<-rep...
2008 Jul 02
auto.key in xyplot in conjunction with panel.text
All, I can't seem to get auto.key to work properly in an xyplot that is employing panel.text. Specifically, I often change the default grouping colors then use auto.key accordingly, but for some reason the same functionality isn't working for this different type of plot. Any help much appreciated. Cheers, David library("lattice") dat = dat...
2006 Dec 14
xyplot: discrete points + continuous curve per panel
I have a number of x, y observations (Time, Conc) for a number of Subjects (with subject number Subj) and Doses. I can plot the individual points with xyplot fine: xyplot(Conc ~ Time | Subj, Groups=Dose, data=myData, panel = function(x,y) { panel.xyplot(x, y) panel.superpose(???) # Needs more here } ) I also like to plot on each panel (there is one Subj per panel) a continuous curve...
2008 Aug 08
Lattice: regression lines within grouped xyplot panels
Dear community, I am looking for a possibility to draw 'regression lines' instead of 'smooth' lines in grouped xyplots. The following code should give you a small example of the data structure. library(lattice) data(Gcsemv, package = "mlmRev") # Creates artificial grouping variable ... Gcsemv$Groups <- ifelse(as.numeric(as.character(Gcsemv$school))>65000, "Group1", "...
2010 Sep 27
scientific vs. fixed notation in xyplot()
Hi I am using xyplot() to plot on the log scale by using scale=list(log=T) argument. For example: xyplot(1:10~1:10, scales=list(log=T)) But the axis labels are printed as scientific notation (10^0.0, etc), instead of fixed notation. How can I change that to fixed notation? options(scipen=4) doesn't work on xyp...
2010 Nov 07
How do I order xyplot line points?
I have the following xyplot figure: The data are organized in a matrix file as follows: Type Elements Chromosome Time bedGz 12000000 chr1 14.240 bedGz 12000000 chr2 7.949 bedGz 12000000 chr3 5.103 bedGz 12000000 chr4 5.290...
2009 Nov 06
using xyplot to plot frequencies
Hi all, First off, thank you for the overwhelming response last time. I'm still trying to figure out the syntax of R to plot some distributions of some frequencies. I've managed to plot histograms from the data, but I would like to clean it up using xyplot from library(lattice). Unfortunately I cannot find a solution to my problem. Given a dataframe "all2", with numerical data in cols "year" and "standard" ("standard" being standardized data) >all2 Year standard 1 2001 0.034246575 2 2001 0.0000...
2006 Jan 16
Legends in xyplot
Hi, How can I add legends in the "xyplot" function, in the "lattice" library? Here is a simulation example: x <- runif(90) z <- sample(1:3, 90, rep=T) y <- rnorm(90, mean = x^2 + z, sd=1) library(lattice) trellis.par.set(col.whitebg()) xyplot(y ~x, groups=as.factor(z), type = c('p', 'smooth&...
2009 Mar 23
using xyplot
Dear R-sians! I am trying generate a bunch of xyplots library(lattice) myPanel <- function(x,y,xl=range(x),yl=range(y),...) { panel.xyplot(x,y, pch=20,col='blue',cex=0.7,xlim=xl,ylim=yl,...) panel.abline(v=0, col='gray30',lty=2,lwd=1.5,...) panel.loess(x,y, span=2/3,family='gaussian',normalize=T,co...
2007 Apr 26
xyplot() and controlling panel.polygon()
Dear R-helpers, How do I tell panel.polygon what greoup and panel it applies to whithin xyplot(y ~ x | c, groups = g panel = function(x, y, groups, ...){ panel.polygon(x = xpol[c, g], y = ypol[c, g], default.units = 'native') panel.xYplot(x, y, groups, ...) llines(x = c(1, 6), y = c(-24.283333, 35.941667), lwd = 2, lty = 3, col = 4) } x[c, g] and y[c, g] descr...