Displaying 20 results from an estimated 10000 matches similar to: "Lattice scales question: using "at" when log = TRUE"
2007 Nov 20
2
Adding points on top of lines in xyplot
All,
I'm trying to make a basic plot: data points superimposed upon the a line
connecting the points w/ a different color. Example below doesn't work as
the first xyplot call doesn't remain. Suggestions?
David
Hour = c(NA,1,2,3,4)
y = c(2,2,3,2,1.5)
xyplot(y ~ Hour, xlab = list("Hour", font=2, cex=2), ylab= list("U_x * V",
font=2, cex=2), type = 'l',
2009 Sep 26
1
Lattice, stripplot (xyplot), plotting data with median line, numeric x-axis
All,
On p.52 of Deepayan Sarkar's Lattice book there is a nice plot of showing
residuals with median lines superimposed or various groups:
library("lattice")
stripplot(sqrt(abs(residuals(lm(yield~variety+year+site)))) ~ site,
data = barley, groups = year, jitter.data = TRUE, type = c("p", "a"), fun =
median)
Suppose we wanted to make a similar plot for a
2005 Oct 03
2
"symbol print-name too long"
All,
I've coded a function and it works manually if I copy it line by line into R.
However, when I try to "load" (copy and paste) the entire function into
R, I get the following error after the listed line of code:
+ N.j.list = lapply(rej.hyp, length)
Error: symbol print-name too long
Does anyone you know what this error means? Strangely, when I copy the
same line verbatim
2008 Feb 28
2
Replacing plot symbols w/ subject IDs in xyplot()
All,
How does one replace plot symbols with say subject IDs when using xyplot? Or
superimpose them next to plot symbols? I searched the archives under
various key words but haven't had much. Any suggestions or links much
appreciated. Sample code below.
David
junk.frm = data.frame(ID = rep(1:16, each = 2), x, y, z = rep(c("D", "P"),
16))
y = c( 0.4, 0.6, -0.1,
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 =
2007 Nov 29
1
Wireframe graph: black and white shading instead of color
All,
The code below produces a color 3D graph. I'd like to make it black and
white shading. I tried setting col.regions to FALSE but this just made it
completely white. I want the graph to look exactly as is, except black (or
grey) and white shading. Is this possible?
Cheers,
David
p.list = c(.01, .1, .25, .5, .75, .9)
cov.list = c(.2, .1, .05) ### leave out .01
X = rep(p.list, 3)
2009 Sep 09
1
Xyplot, multi line title via main, all lines left justified
All,
Below is an xyplot plot with multiple panels and a title produced via main:
library("lattic")
data.ex = data.frame(y = rnorm(10), t = rep(1:5, 2), group = rep(c(0,1),
each = 5))
xyplot(y ~ t | as.factor(group), data = data.ex,
main = list("Put figure caption here xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
want this line left justified" ))
I must be mis-interpreting the
2007 Oct 12
2
Basic plot question: Figure 1.1 Pinheiro & Bates
All,
Sorry for overly simplistic question, but I can't seem to remember how to
create the basic plot shown in Figure 1.1 of Pinheiro & Bates (2004; p.4).
The y-axis delineates a factor (Rail) while the x-axis displays the
distribution of a continuous variable (time) according to each level of the
factor. Didn't see it in archives but perhaps I'm not searching on correct
key words,
2008 Feb 26
2
Subsetting within xyplot()
All,
I'm having problems w/ a simple attempt to subset an xyplot.
The first plot below is a plot of y versus x for certain values of a third
categorical variable z. Now I'd like to further restrict this to certain
values of variable y. Neither of the two attempts below work. Any
suggestions much appreciated. (note: I don't want to merely use ylim since
I have a loess plot and I
2010 Jun 02
2
pdf function, resize xyplot plot automatically
All,
When saving plots to a pdf file via the pdf function, I would like to be
able to automatically expand the graphics device to achieve the same result
as when one does this manually (e.g., clicking the green expand button on
the upper left of the graph on Mac OS). Consider simple example below:
library("lattice")
foo.frm = data.frame(Subject = rep(c(1:4), each = 9), Y =
2006 Oct 31
1
2.4.0 and lattice 0.14-9: Changed behaviour of scales-argumenttck
Dear list,
I have observed a change in the behaviour of the scales-argument tck of
xyplot() after having installed R 2.4.0 (for version info see below).
The help page of xyplot() says about the scales-argument tck:
'tck' numeric to control length of tick marks. Can be a vector
of length 2, to control left/bottom and right/top separately.
But if I issue
xyplot( y ~ x, scales=
2005 Aug 14
1
Labels on axes with log scales with lattice
I using lattice to make some plots and I want to make the y-axis on
some of these plots use a log scale. In the following plot:
x <- 1:10
y <- 2^x
xyplot(log10(y) ~ x)
I get tick marks on the y-axis at 0.5, 1.0, 1.5, 2.0, 2.5, and 3.0. I
would rather have just 3 tick marks at 1.0, 2.0, and 3.0 but labeled
10, 100, and 1000.
I know this can be done using the "at" and
2011 May 10
1
specifying scales in lattice xyplot makes the lines disappear?
I have a dataframe concerning manner of death from death certificates,
from 2005 to 2009 inclusive, with the following structure:
> str(MannerYoung.plot.data)
'data.frame': 245 obs. of 4 variables:
$ year : Factor w/ 5 levels "2005","2006",..: 1 2 3 4 5 1 2 3 4 5 ...
$ manner : Factor w/ 7 levels "Accident","Homicide",..: 1 1 1
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),
2011 May 30
3
Syntax for lattice scales argument with |a*b
I have not been able to figure out the format for specifying limits, at,
labels in scales <- list(relation='free', limits=..., at=..., labels=...)
when there is more than one paneling variable, e.g., xyplot(y ~ x | a*b).
Thanks for any guidance.
Frank
-----
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context:
2005 Jun 14
2
lattice, panel.grid, and scales=list(tick.number=XXX)
I have a Lattice plot in which I want to adjust the number of tick
marks used, and I want to have the drawn grid reflect that change.
Here is what I'm doing:
bwplot(var1 ~ var2, data=df, scales=list(tick.number=10),
panel=function(...) {
panel.grid(h=0,v=-1,...);
panel.stripplot(col="gray40", pch="|", cex=2, ...);
panel.bwplot(...);
})
2008 Aug 27
1
Significant digits for checking values of variable?
All,
I'm witnessing some strange behavior when checking the values of one of my
variables. My guess is that it has something to do with the number of
significant digits being represented, but perhaps not as my variable was
created from other variables that only had one decimal place. See below.
I'm sure this is something basic, any suggestions much appreciated.
Cheers,
David
>
2009 Jul 09
2
Lattice xyplot: same scales within one factor
I am using R 2.8.1 and lattice to produce xyplots conditioned on
two factors. What I would like is to have the scales be free between values
of one factor, but some within. Thus, in the example:
xyplot(mpg ~ disp | factor(gear) + factor(cyl), mtcars,
scales=list(x=list(relation="free")))
rather than having the x scales be free within a gear as well, I want it to
be the same for
2007 Oct 09
2
lattice/xyplot: horizontal y-axis labels with scales(relation="free")
I would like to create an xyplot with varying y-axis limits and horizontal labels at the y-axis tickmarks.
The following does not seem to work, although I think it should, going by the documentation for par.
R version 2.5.1, Windows XP Prof.
Thanks for a clue.
Andreas Krause
library(lattice)
# axis labels for y-axis are horizontal
xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris)
#
2010 Nov 06
1
Prettier axis labels when using log scales in Lattice
Hello,
I am trying to alter the way in which lattice functions (specifically xyplot) print the axis labels when one uses the 'scales' parameter.
I can obtain the effect I want by using
scales=list(y=list(log=10, labels=expression(yvalues)))
where yvalues are the values that would have been printed as the y-axis labels if the "labels" argument had not been present. To help