similar to: lattice xyplot: plot multiple lines with different colors

Displaying 20 results from an estimated 10000 matches similar to: "lattice xyplot: plot multiple lines with different colors"

2008 Feb 05
2
dynamically add items to key of lattice xyplot
Hi all, is it possible to dynamically add key items to an already existing key, belonging to a lattice xyplot? This is what I do: I make an xyplot with an initial key. Later on, I want to extend this key with more items, as more lines are added to the plot (lines are added using trellis.focus("panel")). I guess I need some function to access the key panel in order to extend it,
2008 Jan 31
1
decrease amount of ticks on y axis in lattice levelplot
Hi all, How can I decrease the number of ticks on the y-axis in a lattice levelplot()? I have as many ticks displayed on the y-axis as I have columns of data (1000 columns), how can I decrease this amount of ticks, while still properly displaying all the data? Note that I get my data from a matrix object, in which the z-values of the levelplot are the actual values in the matrix, whereas the
2008 Jan 08
1
storing matrices in a list or vector and preserve dimensions
Hi all, As an R newbie, I wonder how I can store multiple matrices in a list() or vector() object without losing their structure. I should be able to retrieve the matrix from the list later on. If I just append() the matrices to a list() object, they automatically lose their dimensions, whereas I would like to preserve the dimensions of the matrices. Is there any function in R which allows
2008 Sep 16
2
Setting user colors in barchart
Dear R Users, I have a basis question regarding the use of color in the lattice package. I read the ?barchart help page and searched the R archives but could not understand how to do it. I just need to plot a barchart using specific colors for my groups, e.g. green and red instead of the default lattice colors. How do I do that? If I say: barchart(x ~ a_factor, groups=my_groups,
2007 Nov 30
1
Set panel background color in a multi-group trellis plot
Hi everyone, I am trying to change some of the default colors in a multipanel-multigroup lattice graphic, but when I change the panel color to white, the only group that is plotted is the last one, as panel.fill overwrites all the previous ones. Is there any way to set the panel background color for the first panel to a color and keep the rest transparent? My code looks like this: #first set
2002 Mar 28
2
color key with xyplot
Dear all, I'd like to draw a color key beside a graph drawn with xyplot (lattice library). I am aware of the draw.colorkey function (grid library) but don't know how to handle it. Any hint would be appreciated. Renaud -- Dr Renaud Lancelot, v?t?rinaire CIRAD, D?partement Elevage et M?decine V?t?rinaire (CIRAD-Emvt) Programme Productions Animales
2007 Aug 30
2
customizing the color and point shape for each line drawn using lattice's xyplot
Description of what I am trying to do: I am using the xyplot code below to plot the variable ?MeanBxg? against the variable ?PercentVarExplained? for all 9 possible combinations of variables ?bdg? and ?bdx?. Within each of these 9 scenarios I am plotting a separate line for each of up to 9 different methods that I used to estimate the variable MeanBxg. These methods are identified by the numeric
2007 Feb 21
3
Different gridlines per panel in xyplot
In the example R script below, horizontal gray gridlines are drawn at y coordinates where the points are drawn with the code: panel.abline(h=y, v=xScale, col.line="gray") How do I change this so that the horizontal gray gridlines are drawn at y coordinates where the y labels are drawn? The challenge is that each panel has different y-ranges (in my real example the y-ranges and
2011 Mar 14
3
increase a value by each group?
Hi everybody. I'm looking for the way to increase the depth value in 0.01 for each index group. Easier to explain with this example: >my_data=read.table("clipboard", header=TRUE) Depth s_name index 3852 Site_1 144 3852 Site_1 144 3852 Site_1 144 3852 site_A 145 3852 site_A 145 3852 site_A 145 3852 site_A 145 3852 site_B 147 3852 site_B 147 3852 site_B 147 3852 site_B 147 54962
2003 May 13
1
several regression lines in panel of xyplot (trellis graphics)
Dear r-help, I need to draw xyplot() graphs with several regression lines: one line for the whole range of x (the variable on the horizontal axis) and two additional lines for subranges of x. Is it possible to make first regression line (panel.lmline(x,y,...);) to be drawn on the whole graph and regression lines of the subsets to be drawn only over their subsets? I have defined
2008 Aug 11
1
line with of the symbols in the legend -- changable?
Dear R users, I plot data with points(my_data[x]~x, col = x, type = "o", lwd="4") where x is an integer running from 1 to 10, I get points drawn at the plot. When want to do a legend to this I try legend(leg.txt[x], col = x, text.col = 1, pch = 1, bty = "n") where leg.txt contains the names of the variable and x behaves the same. The difference between the
2012 Mar 23
1
R conditional matrix operations - advanced condition
Hello List! I stumbled across an efficiency problem - calculation that would be probably done very fast as a matrix operation I must perform as a for-loop. My intention was to do a conditional operation in matrix depending on the information in first column (summing as many data points from vector my_data as the number specified in the first column of the matrix) but the result is that the
2010 Apr 29
3
control span in panel.loess in xyplot
Dear R gurus.. Is it possible to control span settings for different values of a grouping variable, when using xyplot? an example code shown below d=data.frame(x=rep(sample(1:5,rep=F),10),y=rnorm(50),z=rep(sample(LETTERS[1:2],rep=F),25)) xyplot(y~x,data=d,groups=z,panel=panel.superpose,panel.groups=panel.loess(span=c(2/3, 3/4,1/2)) or something like..
2013 Jan 17
3
how to use "..."
Dear users, I'm trying to learn how to use the "...". I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side of the formula # 'stat_fun' is the function that will be run to
2012 Feb 14
2
How to suppress the empty plots in xyplot (lattice)
Dear all, In a plot command like xyplot(Y~X|ID*PERIOD,data=...) xyplot will generate all the possible ID*PERIOD combinations. But not all of them have data in there. So I have a lot of empty plots. How can I suppress those empty plots and ask xyplot only to generate plots actually with data. Thanks. Jun [[alternative HTML version deleted]]
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
2012 Mar 08
2
xyplot without external box
Dear list members, Within a loop, I need to create an xyplot with only a legend, not even with the default external box drawn by lattice. I already managed to remove the axis labels and tick marks, but I couldn't find in the documentation of xyplot how to remove the external box. I would really appreciate any help with this ------------- START ----------- library(lattice) x<-1:100
2002 Jun 05
2
par(new=T) with xyplot
I know I should not mix base plotting functions with grid/lattice functions, but I have used a "quick-and-dirty" trick of par(new=T) in the past for annotating a trellis-drawn graph in various versions of S-PLUS. The sequence goes something like this: > windows(width = 5, height = 5, pointsize = 10) # open up the device > xyplot(y ~ x) > par(new=T) > xyplot(y2 ~ x) >
2009 Sep 14
2
symbols(x,y, circles=sqrt(N)) with lattice xyplot
How would I create the following plot using lattice? symbols( combPsummary$pastRate, combPsummary$finRate, circles=sqrt(combPsummary$N) ) The idea is to plot finRate vs pastRate using circles whose areas are proportional to the number of people in each group. The following attempt does not really work: xyplot( finRate ~ pastRate , data=combPsummary , panel=function( x, y,
2007 Jul 03
1
xyplot and autokey, maintaining colors specified via "col" in key
All, When specifying colors to xyplot w/ a groups argument, using auto.key no longer maintains the colors properly. I've searched the docs and help but haven't found exactly what I need ... I saw a few examples in the archives involving par.settings but that doesn't seem to do it. I also saw some people using key instead of auto.key, but that didn't seem consistent. Is there a