Displaying 20 results from an estimated 20000 matches similar to: "Lattice: location of key inside a xyplot()"
2011 Aug 16
3
Constructing an additional key inside of a lattice panel
An embedded and charset-unspecified text was scrubbed...
Name: inte tillg?nglig
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110816/b1fd368c/attachment.pl>
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".
2009 Jan 13
1
Drawing Polygons with xyplot in lattice
Hello:
I've come to a dead-end in my search for a solution to a graphing problem that I am encountering. I have used xyplot (from the lattice package) successfully to plot 36 time-series plots (lines) of under-5 mortality for a set of countries in Sub-Sarahan Africa.
What I would now like to do is to add vertical bands (rectangles) that correspond to time-periods during which each of the 36
2008 Aug 05
1
xyplot key issue - line colors
I have a problem regarding the colors assigned to the lines in the key
to an xy plot. I specify the plot like this:
xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type, data = alldata,
layout = c(3,2), type = "l" , lwd = 2, col = c("gray", "skyblue"),
key = simpleKey(levels(alldata$type), points = FALSE, lines = TRUE,
columns = 2, lwd = 2,
2008 Dec 21
1
Trouble with 'smooth' using xyplot in lattice
Hello,
I am fairly new to R am stumped on how to get the xyplot function in the lattice package to produce a scatter plot of count data versus time, such that the count data represent 8 different groups, and the plot produced has 8 unique "smoothed" lines for the different groups. This is the closest I can get to the desired plot:
xyplot(masmean ~ mas, data = Pre96CR.masmeans, groups
2024 Sep 13
1
how to specify point symbols in the key on a lattice dotplot
For me, Bert's suggestion produces a plot with two black symbols above
the plotting region, a circle and a triangle, both filled, and no text.
This, in which I specify several features of the symbols in the key,
dd %>% dotplot( segment ~ transit_time, groups = impact, data = .,
pch = 16:17,
col = 1:2,
cex = 1.8,
scales =
2024 Sep 14
1
how to specify point symbols in the key on a lattice dotplot
On Fri, 13 Sept 2024 at 23:36, Christopher W. Ryan
<cwr at agencystatistical.com> wrote:
>
> For me, Bert's suggestion produces a plot with two black symbols above
> the plotting region, a circle and a triangle, both filled, and no text.
>
> This, in which I specify several features of the symbols in the key,
>
> dd %>% dotplot( segment ~ transit_time, groups =
2010 Jul 02
1
xyplot: key inside the plot region / lme: confidence bands for predicted
I have two questions related to plotting predicted values for a linear
mixed model using xyplot:
1: With a groups= argument, I can't seem to get the key to appear
inside the xyplot. (I have the Lattice book,
but don't find an example that actually does this.)
2: With lme(), how can I generate confidence bands or prediction
intervals around the fitted values? Once
I get them, I'd
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
2009 Feb 04
1
lattice key inside panel
Hello,
I am trying to draw a key inside a single panel in a lattice xyplot. The
panel function uses panel.number() to use a slightly different style for
one of the panels. Once inside than panel I am using
draw.key(list(text=list(lab='catch'),
lines=list(lwd=c(2)),
text=list(lab='landings'),
rectangles=list(col=rgb(0.1, 0.1, 0, 0.1)),
x=0,
2011 Jan 09
1
Rectangle height in lattice xyplot key
Dear All
I have a problem with the height of the boxes in the key in the following.
(The text is over 2 lines to accentuate the problem of no space
between the rectangles.)
Is there an easy way to put a space between the rectangles; size
controls the width but there appears to be nothing for the height?
xyplot(1~1,
key = list(corner = c(0.8,0.8),
2010 Jan 02
2
xyplot: problems with column names & legend
Hello!
one more question about xyplot. If I have data which have space in the
column names, say "xyz 123". How do I create a working graph where
this text is displayed in the legend key?
Now when I try something like xyplot("xyz 123" ~ variable1, data =
mydata, .......) I get nothing.
Also, is it possible to genrate the graph with xyplot(mydata[,1] ~
variable1, data = mydata,
2004 Jun 11
1
lattice: cumsum and xyplot
I want to display cumulative summary functions with lattice.
First I tried to get cumulated data:
library(lattice)
data(barley)
d.cum <- with( barley, by( yield, INDICES=list(site=site,year=year), FUN=cumsum ) )
I got a list of vectors.
I tried to get a dataframe which I could use in xyplot.
But neither of the following functions led to the goal:
d.cum.df1 <-
2012 Apr 11
1
Lattice densityplot with semitransparent filled regions
Hello,
I'm doing some graphics for a paper and a need customize such with filled
region above the density curve. My attempts I get something very near what
I need, but I don't solve the problem of use semitransparent filled. Below
a minimal reproducible code. Someone has any idea?
require(lattice)
# toy data...
dt <- expand.grid(A=1:2, B=1:3, y=1:50)
dt$y <- rnorm(nrow(dt), dt$B,
2009 Jan 25
1
Multiple lattice plots on a page: aligning x-axes vertically
Dear R-help,
I am creating a two lattice plots (a densityplot() and xyplot()) that
have the same x-axes and then 'printing' them onto the same page, one
above the other (see end of email for an example to generate the graph).
With different labels on the y-axis for each plot the left spacing is
different, and the x-axes don't align vertically. Although I can
manually modify the
2010 Oct 26
1
lattice key subtitle
Hello everybody,
Is there a way to add a subtitle to a lattice key?
It is important form me that the subtitle must be linked to the key
because those graphs are produced on a daily temporal scale,
and the numbers of rectangles from the key may be different from day to
day.
Thank you,
Alexandru Dumitrescu
[[alternative HTML version deleted]]
2010 May 11
1
kernel density to smooth plots
Hi r-sers,
I have a data of relative frequencies for the interval of 0-20, 20-40,...380-400. I would like the two data on the same graph using the same x-axis label. My question is how to get a smooth curve using kernel density code if it possible for this data.
> cbind(rel_obs,rel_gen)
rel_obs rel_gen
[1,] 0.000000000 0.0000
[2,] 0.092534175 0.0712
[3,] 0.105152471 0.1092
2008 Jan 15
4
Overlay plots from different data sets using the Lattice package
#After spending the entire day working on this question, I have
decided to reach out for support:
#I am trying to overlay a densityplot from one data set over a
histogram of another, if I were to plot the two individually, they
would look like:
# data frame construction
data.frame.A <- data.frame(rnorm(12*8), c(rep("one", 4), rep("two",
4), rep("three", 4)),
2024 Sep 13
2
how to specify point symbols in the key on a lattice dotplot
I am making a dotplot with lattice, as follows:
dd %>% dotplot( segment ~ transit_time, groups = impact, data = .,
as.table = TRUE,
pch = 16:17,
cex = 1.8,
scales = list(cex = 1.4),
auto.key = TRUE)
impact is a factor with two levels.
They key shows 2 open circles, one of each color of my two
plotting symbols, one
2011 Mar 05
2
lattice: drawing strips for single-panel plots
The strip argument to panel.xyplot seems to be ignored for single-panel
plots. Here is an example:
data(Chem97, package = "mlmRev")
myStrip <- function(...) { ltext(.5, .5, 'strip text') }
densityplot(~ gcsescore, data = Chem97, strip=myStrip)
The figure is printed with no strip. The strip.default documentation
suggests that Deepayan intended this behavior.