Displaying 20 results from an estimated 20000 matches similar to: "xyplot inside a loop"
2008 Jun 26
1
xyplot: tick marks inside panel
Hello all,
Working with a typical xyplot figure (for example the first from example(lattice) )
I would like to place the tick marks inside the panels instead of outside.
I believe working with the axis argument might be the way to do it, but do not see how?
Could anyone help me out in doing this?
In advance thank you.
David Gouache
ARVALIS - Institut du v?g?tal
Station de La Mini?re
78280
2004 Mar 26
1
xyplot inside a for loop problem
Hello everyone
Could someone please explain me why are xyplot() calls inside a for loop
unsuccessful?
Calling plot() is OK but xyplot() just opens the graphics window and that
is all. No error, no warning :-( The same xyplot() outside for loop works
fine.
---------------------------------------------------------
library(lattice)
# OK:
plot(1,2,type='p',main='standalone plot')
#
2009 Jul 31
1
xyplot with 2 panels and 2 different x-scales
Hi All,
I have this data:
type<-c("country","country","country","world","world","world")
place<-c("A","B","C","A","B","C")
rank<-c(1,3,5,512,420,320)
df1<-data.frame(type,place,rank)
and need to produce an xyplot with 2 panels, where the x-values are
labelled:
2011 Aug 24
2
Suppressing error messages printed in xyplot() with panel function
Hello,
I am using the xyplot() function to create a series of scatterplot
panels with lines of best fit. To draw the lines of best fit for each
panel, I am using a panel function. Here's an example:
> species <- as.character(c(rep(list("A", "B", "A"), 10), "B"))
> year <- as.character(c(rep(list("2009", "2009",
2006 Jun 08
1
panel.abline and xyplot
Dear All,
I am wondering on how to use the abline.xyplot with xyplot such that I will have different vertical lines for each panel. More sepcifically, suppose that the xyplot generates 4 panels defined by the combination of two binary variables: X_1 and X_2. i.e.
xyplot(Y ~ Z | X_1*X_2, data = df)
I want something like:
abline(v = 5) if X_1=0 and X_2 = 0
abline(v =
2009 Jan 30
1
How to generate a xyplot with multiple panels using an empty data frame ?
Hi:
I am coding some interactive interface using an xyplot from lattice.
When a user clicks on a panel of the xyplot, a simulation is executed and
the resulting data is plotted on the corresponding panel.
The problem is that I start with an empty data frame and only fill it as the
user request data from simulations.
And, I have found it impossible to create a conditional plot that contains
panels
2008 Sep 02
2
annotating individual panels produced by xyplot
Hi all,
I'm new to R and lattice and panel functions. I've produced a lattice
graph using xyplot. Now I would like to add various, and *different*,
annotations to each individual panel. I tried something like this,
using panel.text ...
<code>
xyplot(dent ~ era | vegzone,
groups=seedtype,
panel=function(...) {
panel.xyplot(...)
2010 Nov 30
2
xyplot : superimposed 2 groups in different panels
Hello,
I would like to plot the following xyplot : for each date of fff (1 date per
panel), bbb=f(aaa) for the two groups (ddd=1 and ddd=2) superimposed.
I can do it by group (see below) but not together.
I looked at http://lmdvr.r-forge.r-project.org/figures/figures.html but I
haven't found what I was looking for (to be honest, I haven't understood all
the examples).
Any help will be
2005 Nov 15
1
combination xyplot and barchart?
Dear R community,
I am having trouble determining how to create the graph I want
utilizing my relatively limited knowledge of R. So far I have been
using the lattice library to create most of what I need.
The dataset (enviro) consists of 2 variables (Temp and Precip) for each
Day of a 2-yr period (Year). I wish to display Temp and Precip along
the y axis plotted by Day on the x axis to allow
2005 Nov 22
2
change axis format for different panels in xyplot in lattice
Dear R users,
My apologies for a simple question for which I suspect there
is a simple answer that I have yet to find. I'd like to plot
panels in lattice with different graphical parameters for the
axes. For example, the code
x<-rnorm(100)
y<-rnorm(100)
z<-c(rep(1,50), rep(2,50))
library(lattice)
xyplot(y~x|z)
plots two panels with the default black axes. Running the
following
2005 Dec 22
1
panel order in xyplot
Hi all,
I have a question concerning xyplot. My data is a data.frame looking like that:
In the first column I have numbers from 0 to 23 (hours of a day), the second column contains the name of a weekday (Day as factor) and the third column contains the number I am interested in. So as an example, the first five rows look like that:
Hour Day Freq
1 0 Mo 23
2 1 Mo
2004 Oct 19
1
lattice, xyplot layout questions
1. How do I get a grid in the background of my xyplots,
like Figure 1 of
http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/Murrell.pdf
2. In my scatter xyplot I have multiple columns and rows of panels.
I would like to have different y scales for panels in different
rows (panels in same rows have same y scales). In such a scenario,
only the outside axes are necessary,
2010 Jul 07
1
xyplot of function only shows diagonal plots
I expected this script to show nine panels, each with a plot of the
function.
But when I run it, only the diagonal panels have content.
Executing > print(trel_1) shows what I expected in the upper left corner.
I am using R ver. 2.11.0 and lattice ver. 0.18-8 on Windows XP under
Eclipse and StatET.
I have searched the documentation, but found no answer. What am I missing?
--- simple.R ---
#
2005 Dec 06
1
xyplot question
Dear R users,
I have a question regarding the use of xyplot in the lattice() package.
I have two factors (each with two levels), and I??d like to change the
order of the panels in a 2x2 panel layout from the default alphabetic
order that R uses based on the names of the factor levels.
My approach is (in principle)
xyplot(y~x|Factor1+Factor2)
Let??s assume, my factor levels for Factor1 are A
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 Jul 22
1
xyplot help
I have a question about xyplot. Suppose I want to plot say a response variable y vs a predictor x within groups defined by a variable called z. And suppose I have another variable v=1,2 with two levels. I would use the following command to get a "spaghetti plot" with two panels defined by v. xyplot(y~x|v,groups=z,type="l") My question is that on top of the panels, the title of
2006 Oct 27
2
Question: xyplot panel configurations for Trellis package
Hi,
I am new to R community and I have a question on panel configurations in
the Trellis package.
Particularly, I have the following code:
require(lattice)
plotTable <- NULL
Date <- seq(as.Date("2006-11-01"), as.Date("2009-12-01"), by = 1)
nYear <- length(unique(format(Date,"%Y")))
plotTable$Date <- as.Date(paste(unique(format(Date, "%Y-%m")),
2006 Jun 07
1
Fw: Help needed using lattice for area plots lpolygon, xyplot.
I am trying to learn how to use the graphics from the lattice package (
and am very new to R).
I am trying to replicate the example plot referenced below, by using the
lattice xyplot & lpolygon to create panels. I get what appears to be the
correct shape of the filled region, but cannot get the position to overlay
properly. I have attempted with various settings of position. ( i.e.
2008 Sep 23
5
xyplot problem
Hi all,
I am trying to produce some panels with dots in an X/Y plane where the
diameter of the dots indicates a Z value (like e.g. earthquake maps where dot
sizes indicate magnitudes and X/Y the location).
This works fine with xyplot, e.g.:
xyplot(1:3~1:3,cex=1:3,pch=16)
However, when I do this with a panel variable, e.g.:
x<-rep(1:3,5)
y <- rep(1:3,5)
sz <- rep(1:5,each=3)
grp
2008 Feb 27
1
Hmisc xYplot won't do conditioning on factors?
Hi,
I am trying to replace (lattice) standard xyplot with xYplot variant from
Hmisc package to be able to add error bars to my plots. However, this does
not work, e.g:
library(lattice)
d <- data.frame(
SKU=gl(3, 1, 21, labels=c("a", "b", "c")),
Weekday=gl(7, 3, 21),
QCRate=runif(21))
xyplot(QCRate ~ Weekday | SKU, data=d)
(this plots nice 3 panels as per