Displaying 20 results from an estimated 10000 matches similar to: "Problem with llines in lattice"
2002 Apr 22
2
lattice x(y)lab and expression
Another question about lattice:
Is there a way to use plotmath in the labels and strips?
E.g.
xyplot(y~x|group,data=test.df,
panel=function(x,y,subscripts,df) {
llines(x,y,col="black",lwd=2)
llines(x,df[subscripts,"lowerCI"],lty=2,col="#aaaaaa")
llines(x,df[subscripts,"upperCI"],lty=2,col="#aaaaaa")
},
2004 Aug 19
1
Clipping of display in Lattice graphics
I'm baffled as to how the Lattice package achieves clipping. Would
someone mind explaining this to me?
Firstly, my attempt using "just" the grid package:
x<-seq(0,3,by=0.3)/2.8
y<-seq(0,1,by=0.1)
grid.newpage()
grid.rect(gp=gpar(fill="pink"))
vp<-viewport(width=0.8, height=0.8)
pushViewport(vp)
grid.rect(gp=gpar(fill="white"))
grid.xaxis()
2007 Apr 26
1
xyplot() and controlling panel.polygon()
Dear R-helpers,
How do I tell panel.polygon what greoup and panel it applies to whithin
xyplot(y ~ x | c, groups = g
panel = function(x, y, groups, ...){
panel.polygon(x = xpol[c, g], y = ypol[c, g], default.units
= 'native')
panel.xYplot(x, y, groups, ...)
llines(x = c(1, 6), y = c(-24.283333, 35.941667), lwd = 2, lty =
3, col = 4)
}
x[c, g] and y[c, g] describe
2002 Aug 12
1
question about cloud() in lattice package
Hi all,
I have been previously been using scatterplot3d package to create some graphs but unfortunately it does not allow me to rotate the
plot on all three axis. The cloud() function in the lattice package does allow me to do so. When I was using scatterplot3d I was
using a script (Shown Below) to calculate the mean, quartiles and range limits for all three axis and I was representing that on the
2005 Oct 14
1
lattice with predicted values
Dear lattice wizards,
I am trying to figure out how to plot predicted values in xyplot,
where the intercept, but not the slope, varies among conditioning
factor levels. I am sure it involves the groups, but I have been
unsuccessful in my search in Pinhiero and Bate, in the help files, or
in the archive, or in my attempts on my own.
My example follows:
FACT is a factor with levels a,b,c
2007 Sep 03
3
plotting predicted curves with log scale in lattice
Hi,
I was taken off guard by the following behavior in a lattice plot.
I frequently want to add a predicted curve defined at more
points than in the formula expression of xyplot. There have
been numerous examples of how to do this on r-help, but I
still often struggle to make this work. I just realized that
specifying one of the axes on a log scale does not guarantee
that the added data for a
2007 Apr 01
1
line endings in lattice plots: square vs. round
I would like to use llines() to draw lines with
square endings in lattice plots. But the default
behavior seems to be to draw lines with round
endings. How can I change this?
I'm looking for a parameter like par('lend') or
get.gpar('lineend'), but trellis.par.get() doesn't
seem to have anything analogous.
I searched the archives but saw nothing on this.
I'm
2007 Sep 07
1
contourplot lines, text, and mtext
If I have a contourplot (in the lattice package) and I want to add
straight lines to it, how do I do this?
I see that there are llines() and lsegement() functions for lattice
plots, but they don't seem to do anything in this case:
library(lattice)
library(KernSmooth)
x=rnorm(10000)
y=x+rnorm(x,0,.5)
a=bkde2D(cbind(x,y),.7)
z=as.vector(a$fhat)
grid=expand.grid(x=a$x1,y=a$x2)
grid$z=z
2006 Dec 08
1
missing factor levels in a lattice barchart panel cause unexpected failure
Hi all - I'm trying to generate lattice barchart graphs with missing
values, and came across the following:
This does not run. I would expect it to:
library(lattice)
D = data.frame(X=1, Y=factor(letters[2], letters[1:2]))
barchart(~ X, D, groups=Y)
Error in grid.Call.graphics("L_rect", x$x, x$y, x$width, x$height,
resolveHJust(x$just, :
invalid line type
which is simply
2002 Dec 16
1
Lattice: panel.superpose function does not pass subscripts and groups arguments (PR#2377)
Full_Name: Volker Franz
Version: 1.5.1
OS: Debian-Linux
Submission from: (NULL) (134.176.77.64)
Hi,
working with the panel.superpose function, I found out that this
function does not pass the subscripts and groups arguments to
panel.groups functions.
In my view, this seems an unnecessary restriction, because the
subscripts-mechanism which allows to access the original data should
also work if
2011 Feb 09
1
add mean and sd to dotplot in each panel using lattice
Hi,
I have a data frame like this:
ScoreDoseSex
2.81Dose1M
1.81Dose1M
1.22Dose1M
0.81Dose1M
0.49Dose1M
0.22Dose1M
0.00Dose1M
-0.19Dose1M
-0.17Dose1F
-0.32Dose1F
-0.46Dose1F
-0.58Dose1F
-0.70Dose1F
-0.81Dose1F
-0.91Dose1F
-1.00Dose1F
-1.77Dose2M
-1.85Dose2M
-1.93Dose2M
-2.00Dose2M
-2.07Dose2M
-2.14Dose2M
-2.20Dose2M
-2.26Dose2M
-2.32Dose2F
-2.38Dose2F
-2.17Dose2F
-2.49Dose2F
-2.54Dose2F
2012 Apr 07
6
Drawing a line in xyplot
i am trying to replicate the following graph using xyplot :
attach(x)
plot ( jitter(type), mortality, pch=16, xlim = c(0.25, 3.75))
lines ( c(1-0.375,1.375) , c ( median(mortality[type==1]),
median(mortality[type==1])), lwd=5,col=2)
lines ( c(2-0.375,2.375) , c ( median(mortality[type==2]),
median(mortality[type==2])), lwd=5,col=2)
lines ( c(3-0.375,3.375) , c ( median(mortality[type==3]),
2004 Jul 29
1
Lattice graphics: adding lines to a plot
I am trying to use the Lattice package to produce the same result as I
can with the base graphics.
With base graphics I can type:
x <- 1:100
y <- x+rnorm(length(x))
g <- lm( y ~ x )
model.y <- g$coef[1]+g$coef[2]*x
plot(x,y) # a plot of the data
lines( x, model.y ) # a plot of the model, superimposed on the first plot
With Lattice graphics I've got this far:
2010 May 09
1
lattice: customising panel.segments using groups
Hi,
I want to customise the segments on an xyplot. Below is a simple example
of what I'm trying to do...
#Example dataset
x <- c(-0.25, 0.25, 0.8)
y <- c(-0.5, 0, 0.75)
gp <- c("A", "I", "C")
my.data <- cbind.data.frame(x,y,gp)
#setting up the parameters to customise the lines with.
ltype <- c(1,2,3)
env.col <-
2012 Apr 19
5
User defined panel functions in lattice
Hi
I have a problem with passing line and symbol parameters to user
defined panel functions
I had a look at the archives and created a panel function on what was
shown and on panel.loess.
I could not to get panel.locfit to work for what I intend it for.
There is another layer to work with before success as lp() is called
from locfit.
xx <-
structure(list(Farm = c("A",
2007 Jan 02
1
lattice panel.linejoin type question
Hello R Users!
I'm trying to use the panel.linejoin function to draw points and lines
(type="o") but it wouldn't do it. Modifying the panel.linejoin function
as such (adding type argument to the panel.lines call).
*original*
panel.lines(vals[xx], yy, col = col.line, lty = lty,
lwd = lwd, ...)
*modified
panel.lines(vals[xx], yy, col = col.line, lty
2006 Jun 01
3
Key titles in Lattice
Hi,
I'm creating some lattice plots that have a key and I'd like to put a
label on the key. The problem is that the text label for the key
prevents the values of the group variables from being shown (see example
below). I don't think that this is a feature, but I might be abusing the
title arg for key.
I'm using R Version 2.3.0 (2006-04-24) on Windows XP and lattice V0.13-8
2010 Jun 18
1
ow to apply a panel function to each of several data series plotted on the same graph in lattice
Hi
is it possible to fit a trend line (or some other panel function) through each of multiple data series plotted on the same graph? Specifically, while one can do something like
xyplot(a+b+c~x)
which plots three series, a,b & c, but can one automatically fit lines through each of them?
I suppose one could generate three more variables afit, bfit, and cfit with a model & predict and
2013 Jun 10
1
Using Lattice, LatticeExtra - Hide right and top axes in multipanel plots
Dear Rxperts,
How do I hide the top and right axes in multiple panel plots? A couple of
examples are provided below.. Would highly appreciate appreciate your
assistance..
#Example 1
library(latticeExtra)
xyplot((1:200)/20 ~ (1:200)/20, type = c("p", "g"),
scales = list(x = list(log = 2,alternating=0), y = list(log =
10,alternating=0)),
xscale.components =
2003 Jan 21
1
[R] proposal: lattice/levelplot: panel.catlevelplot
I suggest to add a panel function to levelplot (or perhaps
to an other 3d lattice function) which is able to translate
the z values into the size of the rectangles.
It could be used to display categorical data.
I append the proposed code and two examples:
- panel.catlevelplot()
- example1.catlevelplot.esoph()
- example2.catlevelplot.esoph()
Wolfram Fischer
#------ CODE