Displaying 20 results from an estimated 20000 matches similar to: "after setting auto.key=TRUE, legend become inconsistent with the graph"
2011 Mar 15
1
Bug in lattice auto.key argument
The Lattice auto.key argument has a bug in R.12.2.
R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)
....
other attached packages:
[1] lattice_0.19-17
loaded via a namespace (and not attached):
[1] grid_2.12.2
If I set up my plot parameters as
require(lattice)
superpose.line.settings <- trellis.par.get("superpose.line")
str(superpose.line.settings)
2008 Jun 21
2
a high-level command for drawing a multiple series graph with each series having a label
I wish to draw a graph representing multiple series (sets of x,y
points). Each series has its own label and points within each series
are joined by a line ordered by their X cooridnate.
I would also like a legend automatically showing which each series is.
Which high-level command can serve this purpose? I looked at my book
but can't find such a command.
Thanks!
Mark
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
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))))
2008 Jun 13
1
Switching the order of legend boxes in a lattice bar graph
I suspect there is a simple solution to this problem, but have been
unable to find it. Below is some code that I have run to create 3
lattice graphs. I have been asked to change the legend so that the
'No' and dark blue are above "Y" and light blue in the legend to
mirror the stacked bars in the graph which feature dark blue above light blue.
I have tried changing the data
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)
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
2023 Jan 28
2
lines through points in lattice legend
Hi,
I'm struggling to find if there is a simple way to make the lines and points overlap in a legend for a lattice plot using auto.key. ?Here is a toy example of what doesn't work (for me) as the lines and points are adjacent rather than overlapping:
library(lattice)
d <- data.frame(x = 1:2, y = 1:4, f = factor(letters[1:2]))
xyplot(y ~ x, d, groups = f, type = "b",?
pch =
2011 Jul 26
2
Lattice: choice of symbol and symbol position in legend
I am making final adjustments to a multi-plot figure using basic and lattice.
In the lattice plot, I would like to include a legend that matches the
format of the legends in the other plots, which consist of appropriately
colored squares (pch 22) followed by text. In lattice, I was able to get a
legend using
auto.key = list(x = .6, y = .6, corner = c(0, 0), pch=22)
but my request for pch=22 was
2006 Aug 09
1
legend on trellis plot
Dear all
I have two questions regarding trellis plots - which I hope you may be able to help me with.
Is it possible to place the key in a trellis plot on the panel (instead of beside the panel)? This will cause the same key to be reproduced on each panel. Please see the plot below - here I placed the legend below the plot. I tried moving the key to the function statement, but it did not really
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 =
2005 Dec 09
1
lattice legend colors recycling sooner than expected
dear r-helpers,
it seems the colors in an automatically generated lattice legend
recycle after the 8th color, even when the user has set e.g.
superpose.symbol$col to be longer than 8. the following example will
illustrate what i mean:
z <- data.frame(x=rep(letters[1:15], each=4), y=rnorm(60),
groups=rep(LETTERS[1:3], 20))
library(nlme)
library(lattice)
plot(groupedData(y ~ x |
2010 Jun 22
2
Lattice legend
I have a moderately complex graph with three panels. There are data points
plotted, and fitted lines are added using a panel function, which includes
"with(alt.data[[which.packet()[1]]]" statements. It all graphs out
beautifully, but none of the usual tricks to get the proper legend to plot
are working, i.e., using auto.key, key, etc.
One message I keep getting is
Error in
2023 Jan 28
1
lines through points in lattice legend
On Sat, Jan 28, 2023 at 2:49 PM Kenneth Knoblauch
<ken.knoblauch at inserm.fr> wrote:
>
> Hi,
>
> I'm struggling to find if there is a simple way to make the lines and points overlap in a legend for a lattice plot using auto.key. Here is a toy example of what doesn't work (for me) as the lines and points are adjacent rather than overlapping:
>
> library(lattice)
2011 Jan 25
1
lattice draw.key(): position of key in panels
Good afternoon,
I am working on a plot that requires custom legends to be placed in some
panels of the plot; other panels do not contain legends. The problem
that I run into is positioning of the legend in individual panels. In
particular, the 'x' and 'y' elements of the key-list are ignored by
draw.key() when it is called from inside a panel function. As a result,
the legend is
2004 Jul 27
1
re: help with lattice plot
Dear List,
I have been using R to create an xyplot using the panel function within
lattice libraries. This plot is based on the data supplied in R named
'Oats'. The graph represents oat yield by nitro level with an overlay of
each variety of oats for each nitro level.
I have three questions regarding this graph:
1) I cannot seem to specify the type of symbol used by the plot, even
though
2008 Oct 15
2
Lattice key title color
Dear R users,
is there a way to define the color of the title for the legend in
lattice?
The help page on xyplot has a lot of details on key options just as the
new book, but no mentioning of a color attribute for the title.
Should I use ltext or is there any other way?
Best wishes,
Erik
[[alternative HTML version deleted]]
2013 Jan 26
2
different legends in lattice panels
Hi listers,
I want to make lattice plots xyplots with the indication of legends
inside each panel with only the points and the lines actually ploted
inside each given panel according to the group(ing) factor.
The code below shows what I have achieved so far and I hope will make
clear what I want to have.
It seems to me that my solution is a very "dirty hack" and there
certainly is
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 Feb 19
1
Change the color and lines of the legend using bwplot
Dear list,
I have following plot, where I have set the color (red and green) and lines (lty=2:3) in the panel.groups but can't not figure out how change the lines and color of the legend in the "key" to the same lines and color as in the panel.groups.
bwplot(means ~ age | scales , dat, panel = "panel.superpose",
groups = sex,scales = list(x = list(rot =