search for: whitebg

Displaying 20 results from an estimated 57 matches for "whitebg".

2004 Jul 18
2
gray background in png
...y background. I would like all plots to have a white (or transparent) background. Below is an example: library(lattice) z <- expand.grid(A = LETTERS[1:8], B = letters[1:6]) z$x <- z$y <- rep(1, nrow(z)) trellis.device(png, file = "test%02d.png", bg = "white") lset(col.whitebg()) xyplot(y ~ x | A * B, data = z, layout = c(4, 6)) dev.off() This is also the case for jpeg and bmp though win.metafile and postscript do not have this problem. Is this a bug or am I missing something obvious? I found one reference that implies this may be expected behaviour but I'm not...
2004 May 01
0
log(0) error is not handled in xyplot, Windows
...We had some exchanges off the list with Deepayan Sarkar about a bug (?) we cannot fix (it seems it does not occur under Unix). It likely needs the help of somebody on Windows. The initial problem was that when running the following script (Windows XP, R 1.8.1 as well as R 1.9.0): > lset(col.whitebg()) > xyplot(rdens ~ annee | habitat, > groups = sp, type = 'b', > scales = list(y = list(log = TRUE))) I got a crash (just show the "hourglass" icon, stay on, GUI.exe no longer answer, and I must interrupt the process via Windows...) When the following is...
2005 Apr 07
4
sweave bwplot error
...other figures: tt <- data.frame(c("a", "b", "c"), c(1.2, 3, 4.5)) names(tt) <- c("x1", "x2") bwplot(x2 ~x1, data = tt) ok now in sweave: \begin{figure}[H] \begin{center} <<echo=FALSE, fig=TRUE, height=5, width=10>>= lset(col.whitebg()) bwplot(x2 ~x1, data = tt) @ \caption{xxx} \end{center} \end{figure} PROBLEM: the pdf of the figure is not correctly created (neither the esp) and the error I get from sweave is: pdf inclusion: required page does not exist <0> thanks for help christoph
2005 Mar 16
1
Note: "The default device has been opened to honour attempt to modify trellis settings"
...in the function and 'detach' after plotting. I have to close the graphics device to get the desired result (and it works only after a few more function calls) Here is the function code "function"<-function(somedata) { .......... library(lattice) trellis.par.set(theme = col.whitebg()) xyplot(log.catch ~ age | yrclass , data = tmp2) detach(package:lattice) savePlot(file="catch curve",type="jpeg") } function(somedata) Thanks in advance. I'm running on Windows XP > version _ platform i386-pc-mingw32 arch i386...
2004 Oct 19
2
Sweave and Trellis in R 2.0.0patched (Windows)
...ime(c("5/1/2004"),format="%m/%d/%Y") data.plot <- data[ data$'DateTime Sampled'>= start1 # & is.na(data$Exclude) & data$'DateTime Sampled' <= end1 ,] trellis.par.set(theme=col.whitebg()) print(xyplot(data.plot$Value~data.plot$'DateTime Sampled'|data.plot$Valve, data=data.plot, panel= function(x,y) { panel.xyplot(x,y,type="b") panel.abline(h=500,col="red") },...
2005 May 03
3
Lattice dotplot with symbols sized and colored
Apologies if this is a naive beginners question. I am trying to create a dotplot with the lattice dotplot function in which my dots are colored differently depending on if positive or negative and sized by sp.nc.bdrs.data$mwZ I have tried... dotplot(sporder ~ cvarorder | direct, data=sp.nc.bdrs.data, cex=abs(sp.nc.bdrs.data$mwZ * 0.05), xlab="climate variables",
2012 May 19
3
Q - scatterplot, plot function & trellis linear regressions???
...t;, ylab="Embryonic development index") > abline(EDIHTL) Q-3 I am trying to make a trellis of linear regressions. I want 3 windows displaying 3 events of linear regression (two-way interactions). I have been trying this: require(lattice) > library(lattice) > trellis.par.set(col.whitebg()) > scatterplot(DevelopIndex~Veg|Aeventexhumed, + xlab = "Vegetation border", + ylab = "Embryonic development index") Error in eval(expr, envir, enclos) : object 'DevelopIndex' not found Please advise, many thanks. Jean -- View this message...
2004 Oct 22
3
dotplot & lattice problems: y axis values and bg color output in jpg
...ke these 2 graphs. x11(height=6.5,width=6.5) data2003<- subset(elaine1,POLCYEAR==2003) plot(data2003$OLDCRASH,data2003$RENUCYC) modall <- lm(RENUCYC~OLDCRASH,data=data2003) abline(modall) dev.copy(device=jpeg,file="plotTrouble1.jpg") dev.off() dev.off() trellis.par.set(theme=col.whitebg(),height=9,width=6.5) dotplot (RENUCYC~OLDCRASH, data=elaine1, xlab="ECR", as.table=T,subset=POLCYEAR==2003, panel=function(x,y) { panel.dotplot(x,y,cex=0.2); panel.lmline(x,y); } ) jpeg(file="plotTrouble2.jpg",bg="...
2005 May 05
6
Need some quick help with lattice - barchart
...') testdata$month <- as.numeric(testdata$month) testdata$year <- factor(testdata$year) testdata <- testdata[do.call("order", testdata), ] png('lexstar_3241.png', width=600, height=as.numeric(length(levels(testdata$year))*200), pointsize=8) trellis.par.set(theme = col.whitebg()) with(testdata, print(barchart(as.numeric(mean) ~ month | year, data=testdata, layout=c(1,length(levels(year))), horizontal=FALSE, scales=list(y=list(limits=c(1,max(as.numeric(mean))+max(as.numeric(stdDev))))), main='Marble Burying - Level I', xlab='Months'...
2004 Jul 27
1
re: help with lattice plot
...IV, V, VI ? The code I have used is included below: ##Data library(nlme) data(Oats) ##Factors Oats$Block<-factor(Oats$Block) Oats$Variety<-factor(Oats$Variety) Oats$nitro<-factor(Oats$nitro) attach(oats) ##Plot library(lattice) lset(col.whitebg()) xyplot(yield~nitro|Block, data=Oats,xlab="Nitrogen Level",ylab="Yield of oats",subscripts=T, groups=Oats$Variety, as.table=T, panel=function(x,y,groups,subscripts){ panel.superpose(x=x, y=y, groups=Oats$Variety, subscripts=subscripts,pch=18) panel.superpose(x=x, y=y, groups=O...
2004 Feb 04
5
Date Time Conversion problems...
...te <- strptime(as.character(data2$Date),format="%m/%d/%Y") start <- strptime(c("1/01/2003"),format="%m/%d/%Y") end <- strptime(c("12/31/2003"),format="%m/%d/%Y") data3 <- data2[data2$Date >= start & data2$Date <= end,] lset(col.whitebg()) xyplot(Cost~as.POSIXct(Date)|Name,data=data3, xlab="Date", ylab="PO Cost($)", ylim=c(0,10000), panel= function(x,y){ a <- mean(y) panel.grid(h=-1,v=2) panel.xyplot(x,y) panel.abline(h=a,col="red")...
2005 Apr 25
1
Need help with panel.segment..
...;,'mean','stdDev','miceCount'); testdata[c("month", "mean")] <- lapply(testdata[c("month", "mean")], function(x) as.numeric(levels(x)[x])); testdata <- testdata[do.call("order", testdata), ]; trellis.par.set(theme = col.whitebg()); with(testdata, barchart(mean ~ month | year, horizontal=FALSE, layout=c(1,2), origin = 0, sd = as.numeric(as.character(stdDev)), count = as.numeric(as.character(miceCount)), panel = function(x, y, ..., sd, count, subscr...
2004 Apr 13
1
lattice problem in R-1.9.0
Hi all, I just installed R-1.9.0 on Windows 2000 from binaries. Yesterday, on R-1.8.1 I ran a script that looked like: library(lattice) tmp <- expand.grid(A = 1:3, B = letters[1:2]) tmp$z <- runif(NROW(tmp)) trellis.device(png, file = "x1081.png", theme = col.whitebg) xyplot(z ~ A | B, data = tmp, panel = function(x, y, i) { panel.xyplot(x, y) ltext(1, 0.95, paste("i =", i), adj = 0) }, ylim = c(0, 1), i = 10) dev.off() In R-1.9.0, the same script gives the following error message: Error in trellis...
2005 Jan 03
1
Black and white graphics and transparent strip panels with lattice under Sweave
...to specify that strip panels are to have transparent backgrounds and graphs are to be in black and white when lattice is being used with Sweave? I would prefer a global option that stays in effect for multiple plots. If this is best done with a theme, does anyone have a lattice theme like col.whitebg but that is for black and white? I'm using the following with lattice 0.10-16, grid 2.0.0: platform i586-mandrake-linux-gnu arch i586 os linux-gnu system i586, linux-gnu status major 2 minor 0.0 year 2004 month 10 day 04 language R Thanks, Frank -- Frank E Har...
2006 Sep 11
1
graphics: y limit on xyplot
...o set the y axis limit of an xyplot using the object 'ylimit', but receive this error: [1] 990 Error in extend.limits(limitlist[[i]], axs = axs) : improper length of lim I get the same error if I use ylim. library(lattice) trellis.device(col = FALSE, theme = lattice.getOption("col.whitebg")) name <- "Variable name" symbols <- c(1,2,3,4,5,6,7,8,9) patientp <- c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9) varp <- c(826,119,168,90,572,323,122,10,42,900,250,180,120,650,400,130,12,33) visitp <- c(1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3) yall <- c(varp,varl,varm,varh...
2007 Nov 29
1
Wireframe graph: black and white shading instead of color
..., each=6) Z = c(2475.000000, 225.000000, 75.000000, 25.000000, 8.333333, 2.777778, 9900.000000, 900.000000, 300.000000, 100.000000, 33.333333, 11.111111, 39600.000000, 3600.000000, 1200.000000, 400.000000, 133.333333, 44.44444) lattice.options(default.theme = "col.whitebg") wireframe(Z ~ X * Y, scales = list(arrows = FALSE), bg = "white", drape = TRUE, shade = FALSE, colorkey = FALSE, xlab = "p", ylab = "C.O.V.", zlab ="n")
2006 Jan 16
1
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'), span = .67) Thanks in advance, Ravi. [[alternative HTML version deleted]]
2006 Oct 25
1
density plot text
...nsions of a graphics device? I don't mean the x and y limits of a plot, but rather can I change the dimensions of the default (square) graphics device? Many thanks Murray try <- (rnorm(100, mean = 5, sd = 3)) library(lattice) trellis.device(col = FALSE, theme = lattice.getOption("col.whitebg")) densityplot(~try) normtest <- shapiro.test(try) normtest pvalue <- round(normtest$p.value,5) normtext <- paste(normtest$method,"p-value =",pvalue) normtext xcoord <- max(try)*0.6 text(xcoord,0.1,normtext) # alternative plot(density(try)) text(0,0.1,normtext) -- Mu...
2005 Apr 22
1
Need help arranging the plot in different fashion than the default format
...;,'mean','stdDev','miceCount'); testdata[c("month", "mean")] <- lapply(testdata[c("month", "mean")], function(x) as.numeric(levels(x)[x])); testdata <- testdata[do.call("order", testdata), ]; trellis.par.set(theme = col.whitebg()); barchart(month ~ mean | year, data=testdata) I want to have the years come one below the other rather than next to each other which can be achieved by layout(c(1,2)), and the x axis to be the month and the y axis to be the mean. I would really appreciate if someone can tell me how to achieve t...
2004 Jun 23
2
Tick marks in xyplot
...bottom and left in EACH panel, but only tick labels at the bottom and left of the whole graph. I have browsed the internet, as well as the help page without success. If anyone could help me find the path to the solution I would appreciate. Here is an example, this is the best I could do: lset(col.whitebg()) x.data <- rnorm(16,20,7);y.data <- rnorm(16,.55,.25); z.data <- sample(1:4,16,replace=T) xyplot(y.data~x.data|z.data, layout=c(2,2), scales=list(x=list(alternating=F),y=list(alternating=F),tck=c(-1,0))) Cheers ??lafur A. Ing??lfsson Institute of Marine Research PO Box 1870 Nord...