similar to: define colors for groups in lattice xyplot

Displaying 20 results from an estimated 10000 matches similar to: "define colors for groups in lattice xyplot"

2010 Aug 21
1
lattice::xyplot() with one factor for points and another for lines
Hi: In lattice, how does one handle separate graphical behavior for two different factors? In the xyplot below, the objective is to use the levels of one factor to distinguish corresponding shapes and colors, and the levels of the other factor to perform level-wise loess smooths. # Illustrative data: d <- data.frame(time = rep(1:8, each = 6), val = rnorm(48), gp1 =
2011 Jun 28
1
means and error bars on xyplot for binary data
Hi, I have binary (0,1) data for a trait as my response variable, and a dependent variable, genotype, with three classes (AA, AB, BB). I would like to plot this data so that across the three genoytpes, even though the points are all either 0 or 1, i want them to stack up or be seen using 'jitter'. So far I have been able to do this using xyplot {lattice} (code below) but could not get
2008 Jun 26
3
Connecting lines across missing data points, xyplot
All, I have data across 5 time points that I am graphing via xyplot, along with error bars. For one of the variables I have missing data for two of the time points. The code below is okay but I can't seem to get the lines to connect across the missing time points. Does anyone now how to rectify this? Cheers, David Afshartous library(lattice) ## the data junk = data.frame( Visit =
2005 Feb 10
1
xyplot() question
Dear R Users, I have an xyplot() where different plotting symbols are used for subgroups (originally used within S-Plus, but hopefully it?s also applicable to R users). How can I fit separate regression lines for every subgroup? So far, I can only plot the overall fitted line. The code looks like this: trellis.device() sps<-trellis.par.get("superpose.symbol") sps$pch<-1:7
2017 Jan 21
2
problema con grafico lattice ....
Hola, Por si lo quieres con colores rellenando cada punto: #---------------- library(data.table) library(lattice) dat <- read.table("pba.csv", header=TRUE, dec=",", as.is=TRUE) row.names(dat) <- NULL dat <- as.data.table(dat) dat$mycol <- ifelse(dat$sol =="ControlAE", "red", dat$sol) dat$mycol <- ifelse(dat$mycol
2006 Aug 25
2
xyplot with different symbols and colors?
Dear List, I try to make a xyplot with different colors and symbols, I came this far: library(DAAG) xyplot(csoa~it|sex*agegp,data=tinting,groups=target,pch=list(1,2),auto.key=list(space = "right")) this produces a plot with different colors and symbols but unfortunately the legend does only follow the color scheme and not the different symbols. Any suggestions what to change? And
2002 Jul 17
5
R crashes when using "xyplot" (PR#1801)
Full_Name: Carsten Dormann Version: 1.4.0 OS: Windows 2000 Submission from: (NULL) (192.171.129.9) Hello, using the function xyplot I repeatedly had R crashing. One example is from the book of Mick Crawley (Stat. Computing in Splus), where the commandline reads: xyplot(Weight~Age|Genotype, pch=16) I also had the same phenomenon with my own data and commands even simpler. I reinstalled
2013 May 02
3
Lattice xyplot multipanels
Derar Rxperts, I have a strange situation.. I see curly brackets around "strip.levels" in multipanel strips while using lattice::xyplot. .How do I get rid of the curly brackets? For some reason, I am not able to reproduce the problem using an example below... Any suggestions are highly welcome! Thanks, Santosh q <-
2012 May 29
2
use xyplot to plot mean and CI by groups
Dear R users, I am trying to use xyplot to draw group mean and CI. The following is the sample code. But I want: 1. Use different colors and symbols to draw individual points, CI and the lines connect group means from different time points; 2. Add jitters to x axis to allow CIs not be overlapped Could anyone modify the attached code to achieve this? Thanks library(lattice)
2017 Jan 20
4
problema con grafico lattice ....
Estimada comunidad, estoy tratando de hacer un grafico y no resulta (adjuntos datos). Se grafican la vble "con" en el eje X y "can" en el eje Y. Se agrupa por la vble "sol". Se deben agregar como lineas horizontales los valores de "can" asociados a "sol" "ControlAE" y "ControlAB", para lo que uso panel. Pero al agregar
2011 Oct 10
3
Superposing mean line to xyplot
Dear R-users, I'm using lattice package and function xyplot for the first time so you will excuse me for my inexperience. I'm facing quite a simple problem but I'm having troubles on how to solve it, I've read tons of old mails in the archives and looked at some slides from?Deepayan Sarkar but still can not get the point. This is the context. I've got data on 9 microRNAs, each
2009 Oct 25
1
different plot symbols in key using xyplot
I'm using xyplot in a very simple way---a scatter plot of several data sets. I'm having a problem getting auto.key to display different point characters. The following produces a plot that employes different colors, all with pch(1), for the different groups, with a matching key. xyplot(Force~Time, rawData, groups=Sample, panel = panel.superpose, auto.key=TRUE) The following
2002 Nov 21
1
more than one level of grouping in xyplot
Dear listers, Let use say that I want to display the Pixel dataset (in the NLME library) xyplot(pixel~day|Dog, groups=Side, data=Pixel, panel=panel.superpose, panel.groups=panel.xyplot, type="b", pch=16) (I know, there are better examples, ...) Now, how could I change the colours of the symbols accordingly to another factor changing within subject and side form time to time? (let us
2005 Sep 17
4
xyplot and abline
Dear All, I wonderif there is a simple way to draw a regression line in the xyplot: more specifically, let: age <- c(20:30, 31:40 ) age.cut <- cut(age, breaks = 2 ) y<- rnorm(20) x <- rnorm(20,4,1) xyplot(y ~ x| age.cut, xlab="x", ylab="y") How to draw (in the plot given by xyplot) the two regression lines (y ~ x) corresponding to the two category
2008 Jul 02
1
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 = data.frame( Y = c(rnorm(18,1),
2009 Apr 07
2
xyplot - label one line
Hi All, I have a panel xyplot with 2 lines in each panel. I'd like to label one line only but don't know how to do this. The code below labels both lines. Any ideas how I could change it to show the y-values of only one of the lines? Many thanks! xyplot(apples + bananas ~ year | category, data=fruit, as.table=TRUE, par.strip.text=list(cex=1.2,font="bold"), par.settings =
2010 Oct 09
1
point characters THICKER in xyplot()
Hi, how can I make the point characters thicker (NOT larger) in xyplot when groups= argument is used? dat<-data.frame(x=1:100,y=1:100,group=rep(LETTERS[1:5],each=20)) ### lwd=2 doesn't work here xyplot(y~x,groups=group,data=dat,col=1:4,pch=1:4,lwd=2) ### lwd=2 works with panel.points(), but grouping is messed up! xyplot(y~x,groups=group,data=dat,col=1:4,pch=1:4,
2006 Jun 06
2
error bars in lattice xyplot *with groups*
Hi all, I'm trying to plot error bars in a lattice plot generated with xyplot. Deepayan Sarkar has provided a very useful solution for simple circumstances (https://stat.ethz.ch/pipermail/r-help/2005-October/081571.html), yet I am having trouble getting it to work when the "groups" setting is enabled in xyplot (i.e. multiple lines). To illustrate this, consider the singer data
2008 Oct 07
2
panel.groups: use group.number to define colors
Dear list, I've been trying this for a few hours and I just don't understand how lattice works with groups and subscripts. Consider the following example, > xx <- seq(1, 10, length=100) > x <- rep(xx, 4) > y <- c(cos(xx), sin(xx), xx, xx^2/10) > fact <- factor(rep(c("cos", "sin", "id", "square"), each=100)) > fact2
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups or subpopulations) on the same plot region, using different line types "lty" or colors "col" to distinguish the functions (or groups). In traditional graphics, this seems straightforward: First plot all the data using 'type="n"', and subsequently execute a series of "points"