similar to: Change the colour of lines in the xyplot?

Displaying 20 results from an estimated 20000 matches similar to: "Change the colour of lines in the xyplot?"

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
2011 Jun 14
1
xyplot Legend Title and Position
Dear R Community, I'm using xyplot in Lattice with a legend and a title on the legend. The title on legend is being cut off, as can be seen by running the code below. The legend is on the right, but I would like to get to the top right of the graphics window. Is there a way to get the legend title to display correctly and move the whole legend up the the top right? Thanks, Justin ### R
2010 Jul 08
1
xyplot help
Hi, I am learning xyplot. I have an example dataset attached. plotdata<-read.table("plotdata.txt",sep='\t',header=T,row.names=1) head(plotdata,n=4) y x type 1 -4.309601 -0.7448405 A 2 -4.715421 0.7875994 A 3 -2.310638 0.5455310 A 4 -2.685803 10.4116868 A xyplot(y~x,groups=type,plotdata, auto.key=T) This shows different colors for different
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
2011 Feb 21
1
wrong lines in auto.key xyplot
Hi all, I'm having a problem with the auto.key function in xyplot. I changed the symbols an lines styles using these commands trellis.par.set(superpose.symbol=list(pch=c(0,1,2,3,4,5,6,8,15,16))) trellis.par.set(superpose.symbol=list(col=c(rep("black",11)))) trellis.par.set(superpose.symbol=list(cex=c(rep(0.6,11))))
2009 Sep 28
1
xyplot help - colors and break in plot
Dear List, I am new to lattice plots, and am having problems with getting my plot to do what I want. Specifically: 1. I would like the legend to have the same symbols as the plot. I tried simpleKey but can't seem to get it to work with autoKey. Right now my plot has dots (pch=19) and my legend shows circles. 2. I have nine groups but xyplot seems to only be using seven colors, so two
2010 Apr 04
2
One question about saving graph by using xyplot
Hey, folk. I am trying to get many figures by using the function "xyplot" in the library "lattice". I tried to using the loop to finish it quickly. But I cannot open the saved file after I run the program. But if I use the function "plot" to get other simply figures, it can work. So I want to ask how I can get the saved figures by using "xyplot". The
2006 Aug 02
1
help with formatting legend in xyplot
I am doing a xyplot: (x~y, groups = z, pch=8, auto.key=T). This changes the symbol in the graph to an asterisk (*), but not in the legend, which is still an open circle. I have found out how to manipulate the position and the color of the letters in the legend, but cannot change the legend symbol to match the symbol in the graph. Could you help? Thanks, Kaushik [[alternative HTML version
2009 Jun 19
1
Adding site id to xyplot
Dear R Lists, Can anyone help me add site IDs (site: 1~50) directly to my xyplot. I have 50 sites and collected observations from the sites at 13 different time points. I want to look at the change of my observations in each site. I was able to make a graph using xyplot, however, I can't find how to add site IDs within the graph not adding them in the legend. Overall, I would like to be able
2009 Jun 24
3
distinguish regression lines in grouped, black and white lattice xyplot
Hi, I've got the following problem which I cannot think of a solution right now: if got a lattice xyplot in black and white and a grouping variable with many (more than 8 values) and I plot it as regression lines (type="r"), just like this one (not reproducable but that's I guess not the point here): xyplot(log(AGWB) ~ log(BM_roots), data=sub_agwb_data, groups=species,
2008 Aug 05
1
Labeling lines in xyplot
Hello, I apologize in advance as this example seems really elementary. Below I have created a simple scatterplot with lines. I would like to label each line with the name of the village, instead of using a legend. Can someone please let me know how to do it. Thanks in advance -- John Pop=c(1406,1862,2333,2664,2685,2521,2726,0,0,0,0,214,289,365,900,952,1002,1205,1041,942,1004,
2008 Sep 09
6
plotting group means
Hi all, I want to plot the grouped means of some variables. The dependent variables and the grouping factor are stored in different columns. I want to draw a simple line-plot of means, in which the x-axis represents the variables and y-axis represents the means. The means of the groups should be connected by lines. So far, the only function that I could find comes closest to what I'm
2008 Jun 24
1
after setting auto.key=TRUE, legend become inconsistent with the graph
When I use xyplot (from package lattice) to produce a multi-series graph: xyplot(linear+quadratic+sqrt~x, data=df, main="complexity of different functions", ylab="y", col=c("red", "black", "orange"), type="b", lty=c(1,2,3), pch=c(1,2,3), auto.key=TRUE) where I changed the default colour, line type and data point type so that each series
2006 Nov 23
1
loess lines in xyplot with two or more variables on the left side of a formula
Hello: I recall something like this being discuss recently, but I can't seem to locate an example in the archives. I have data like the following: df <- expand.grid(1:4, 1992:2002) names(df) <- c("MSA", "YEAR") df$IDUPREV <- runif(44) df$VALIDAT <- rnorm(44) I want to create an xyplot() with separate loess lines for each series (IDUPREV and VALIDAT) in
2006 Aug 24
5
xyplot tick marks and line thickness
Hello, A made a xyplot using the lattice library in R (latest version). The publisher of our paper has requested: 1. all tick marks should point inwards instead of outwards. 2. All lines should be thicker (lines, axes, boxes, etc. Everything). Lines is easy...I used: lwd=1.5 but what about the lines of the axes, and the lines that build up the plot itself?....? Any
2008 Sep 24
2
lattice xyplot symbols instead of colors and legend matching plot symbols or colors
I would like to use the data below where the plots are close to what I want. Instead of color I would like to use different symbols, and have the symbols in the legend match the graphs. I am also going to add a regression line to these I know about the type="r" (which is fine for these particular graphs) argument, but it fits the subsets instead of the entire data set-- should I use a
2008 May 13
1
Legend in scatterplot and adding regression lines
Hi R users The scatterplot (used package R-Cmdr ) obtained has the legend off the plot in the upper left I would like to decide where to put the legend - is that option still available and how do I do it? code: Dataset <- read.table("J:/Pigmatingsb.txt", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
2007 Jun 18
1
Second y-axis in xyplot (lattice) where y1 and y2 have different ranges
Hi all, I realize this is asking a lot of lattice, but I want to add a second y axis inside a xyplot and have y1 and y2 have different ranges. Given dat below, I can add a second y axis by overlaying a new plot with par(new=T) and label axis 4 with standard graphics. I've seen an example for doing something similar in xyplot even though Deepayan has indicated that lattice isn't the right
2005 Feb 24
1
Place more than one key with xyplot
Dear R-users I have some trouble to generate more than one key with xyplot using the legend argument. I would like one key with rectangles: library(lattice) library(grid) key1 <- list(rectangles = list(col= c(rev(heat.colors(5))[1:5], rev(heat.colors(5))[4:1])), title="Percentiles", space="right",
2008 Jan 11
4
lattice color problem with symbols: bug?
Dear useR's, I have a problem with the lattice plotting of some symbols: library(lattice) test<-data.frame(x=c(2,3,1,5),u=c(rep(1,2),rep(2,2)),g=c(rep(c(1,2),2))) xyplot(x~u,groups=g, data=test, par.settings=list( superpose.symbol=list(pch=c(22, 23),cex=c(1.7,1.6),col="black") ), key=list( text=list(c("t1","t2")), space =