Displaying 20 results from an estimated 40000 matches similar to: "coloring individual points in lattice xyplot"
2010 Sep 03
3
define colors for groups in lattice xyplot
Dear all,
Lattice provides automatic coloring for subgroups on each panel by the
simple use of a groups statement. For an application I want to change
these colors to a predifined set. This works well using a panel function
in stead of the default as long as there are only points in the graphs.
When I set type="b" things get messed up. Any idea why? I include sample
code for
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 =
2002 Dec 19
1
lattice and display
Hi,
I have just started using lattice and it looks great. But I already have 3
questions about xyplot display.
----------------------------------------------------------------------------
---------------------------------
1.I would like to create two differeny xyplot with different color to
identify my different groups but I have trouble applying colors.
Here are the scripts
2004 Feb 05
2
xyplot (lattice): colours of lines
using either one of the following codes:
xyplot(X ~ time | center, type="l", panel=panel.superpose, groups=subject,
col = treatment)
xyplot(X ~ time | center, groups = subject,
panel = function(x, y, ...){
panel.superpose(x, y, col = treatment, type = "l", ...)
})
I get two different colours for the lines by these colours do not match the
corresponding
treatment
2017 Sep 12
0
show 0 at y axis in xyplot lattice
Hi Maria
Rule 1 make sure your data is in the right format
dat <- source("G:/1/savedat.txt")
> dat
$value
Location Date Zn2 upper.zn lower.zn
1 upstream 2016-04-27 29.92477 55.59800 13.912207
2 spill 2016-04-27 12.84040 22.07006 6.964934
3 downstream 2016-04-27 22.49673 41.60901 11.739109
4 upstream 2016-06-28 23.98425 45.60219 10.690640
5
2005 Mar 22
1
Question with lattice xyplot
Hi All,
I have a quick question and any help is greatly appreciated. For the following data when I try to produce the image using xyplot function in lattice package, the key has 4 rows instead of 2. Can anyone tell me what I'm doing wrong and what is the way to fix the problem. Here the code that I'm running
studyData <- as.data.frame(t(structure(c(
"A",0,4.477,
2008 Aug 08
1
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,
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 =
2017 Sep 12
2
Σχετ: show 0 at y axis in xyplot lattice
Dear all,
Thank you very much for the help. ylim=c(-5, 80) worked.?
Regarding the reproducible example, I used dput () and saved the file as txt. It is not the first time that I used this way and normally it works. Because when I try to attach a .csv file with the data, most of the time it doesn't go through.?
I will know for the next time.?
Many thanks.
Regards,Maria
???? 2:11 ?.?.
2013 Mar 12
2
Specifying point symbol fill colour in lattice xyplot keys
Dear all,
When defining explicit keys with xyplot, I have previously used the fill
parameter to set the background colour of point symbols. That's no
longer working for me, and I am wondering whether it's a bug or whether
I've misinterpreted the documentation and have been relying on a feature
wasn't intended. If the latter, can anyone suggest the correct way to do it?
2017 Sep 12
0
Σχετ: show 0 at y axis in xyplot lattice
Dear Maria
The file you attached to your first e-mail did come through but I think
some people on the list must have missed it.
Michael
On 12/09/2017 12:54, Maria Lathouri via R-help wrote:
> Dear all,
> Thank you very much for the help. ylim=c(-5, 80) worked.
> Regarding the reproducible example, I used dput () and saved the file as txt. It is not the first time that I used this way
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),
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
2008 Aug 07
2
lattice: add vertical lines in xyplot
Hi list,
This is a very basic question about lattice: I wish to add some
vertical lines in each panel of a xyplot as demonstrated in this
example:
> library(lattice)
>
> 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))
2009 Aug 18
1
second y-axis in lattice xyplot
Dear R-help,
I recently discovered lattice xyplot, but have been struggling with plotting a second y-axis. I am able to do this with plot() but can't figure it out in xyplot. Any help would be appreciated.
I have found help on adding a second Y-axis when the data is all part of the same data frame, but I have two different data frames.
Both data sets are being plotted against "Date".
2006 May 12
1
superpose two variables in lattice/xyplot
Dear R users,
I try to use xyplot() to display two different response variables from
the same dataframe per panel, but don't succeed:
xyplot(ptot.seaslog ~ vmcwit | seas, data=reeks, as.table=TRUE,
panel = function(x,y){
panel.xyplot(x, y, ylim=c(0,1))
panel.superpose(x=reeks$vmcwit, y=reeks$ptotbin,
panel.groups = "panel.xyplot",
2007 Jun 08
2
wrapping lattice xyplot
This is an expanded version of the question I tried to ask last night
- I thought I had it this morning, but it's still not working and I
just do not understand what is going wrong.
What I am trying to do is write a wrapper for lattice xyplot() that
passes a whole bunch of its secondary arguments, so that I can produce
similarly formatted graphs for several different data sets. This is
what
2010 Oct 17
1
lattice xyplot - formatting of multiple Y variables when using subgroups
Hi all,
Using xyplot I want to print to Y variables (y1, y2) versus X, conditional
on the group.
How can I obtain a line (type="l") for one relationship (ie. y1 ~ x) and
points (type="p") for the other (y2 ~ x) ?
library(lattice)
# create some sample data
df<-data.frame(group=as.factor(c(rep("a",4), rep("b",4))), # grouping
variable for conditional
2017 Sep 11
4
show 0 at y axis in xyplot lattice
Dear all
I am trying to make a plot in xyplot lattice by groups. I would like to show "0" in y axis but I don't want to be aligned with the x axis. I want to be a little bit above.
I have tried many options but I don't get what I want. I also tried ylim=c(0, 80) but both 0 and 80 are fully aligned with the x-axis and the upper boundary of the plot, respectively:
xyplot(upper.zn +
2010 Jul 01
1
Coloring axis labels on lattice xyplot
Hello,
First let me apologize for replying/changing subject when I initially
asked this question. Its my first time using a mailing list of any sort!
I am trying to color particular labels on my lattice xyplot.
For example:
library(lattice)
z = data.frame(x = 1:5)
xyplot(x~x, z)
Is there any way for me to make the "4" on the y-axis blue?
Thanks,
Andy