Displaying 20 results from an estimated 20000 matches similar to: "'From' and 'to' arguments in panel.abline"
2009 Jul 28
2
xyplot, panel.abline, from, to
All,
I'm trying to truncate some lines that are added to an xyplot via
panel.abline to allow additional space for inserted text. According to
?panel.abline it seems like "from" and "to" will do the trick but it does
not work for the sample code below. Any hints much appreciated.
Cheers,
David
x = seq(1,8)
y.1 = .6*x + 3.5 + rnorm(8, 0, .5); y.2 = .4*x + 1 + rnorm(8,0,
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 =
2011 Apr 19
1
Define ylim in lattice plot based upon panel function output
Dear R-users,
By default, the xyplot function automatically defines the axis ranges based
upon the content of y and x variables. However, when one includes some calls
to other panel.<something> functions in the panel argument, the results
might be out of range and not show up in the final graphs (see lower ends of
the loess line in the following example). Is there a way one can capture the
2010 Dec 09
4
[lattice xyplot] Help needed in help in customizing the panel.abline() function
Hi folks,
I need some help in customizing the abline() function to be used in a
lattice plot. I have attached a reproducible example below.
I need help in the following snippet:
disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type =
"h",lwd=2,panel = function(...) {
panel.abline(v = 8, lty = 2)
panel.xyplot(...)
})
Is there a way I can give
2013 Nov 19
1
como agrego una linea dibujada con abline() en la leyenda de un grafico ?
Estimado Eric
En Hmisc la función labcurve puede ser útil, en todos casos crear una
curva con valores constantes, habría que intentar, pero labcurve en
algunos ejemplos en mi computadora no anda.
Ayer envié dos correos, el primero era de latticeextra, usted nombra
lattice, pero podría funcionar, en latticeextra:
## horizontal and vertical lines
xyplot(ysim ~ xsim) +
layer(panel.ablineq(v
2013 Oct 04
2
abline is not plotting
Hello there,
I have some data I want to plot together with a best-fit line. (see MWE
below)
The points from the first plot does appear as expected, but the abline does
not appear, no matter what I change. I removed the log parameter before, but
the abline is a very steep line around the origin. I really want to keep the
logarithmic scale, plus a working abline.
Can someone help me with that?
2011 Aug 12
1
lattice panel.abline use
Dear R-users,
I am unsuccessful in trying to add an horizontal line to all graphs in the
example below:
library(lattice)
val<-runif(15)
x<-rep(seq(1:5),3)
type<-c(rep("a",5), rep("b",5), rep("c",5))
xyplot(val ~ x | type, panel.abline(h=.6))
Any hints are appreciated.
Best regards,
---Jean
--
View this message in context:
2009 Jan 12
1
Problem between panel.abline and log scales (lattice)
Hello and Happy New Year to all R-Users !!!
I would like to plot a lattice graph with a logarthmic y axis and add two
reference lines that is :
ref<-c(0.0070, 0.0096)
graph1<-xyplot(data$y1 ~ as.numeric(strptime(data$x1, format="%Y-%m-%d
%H:%M:%S")) | as.character(data$Code),
list(y = list(log = T)),
xlab="X'", ylab="Y",
panel = function(...) {
2005 Aug 03
1
abline and linearity over groups
Dear R users, please can you help me understand the behaviour of abline using function lm.
I'm trying to learn linearity over groups. So I make three groups with 10 values each:
test=data.frame(cbind(
l=c(rnorm(10,0,30),rnorm(10,100,30),rnorm(10,200,30)),
t = c(rep(0,10), rep(1,10), rep(2,10))
))
when I do:
plot(test$l~test$t)
abline(lm(test$l~test$t))
the abline is a straight line
2007 Apr 04
2
Annotate a levelplot (using abline) - Difficulty with trellis.
Hi,
I am generating a beautiful plot with the 'levelplot' function over my
square matrix of data. In order to help visualise the data I would
like to draw a diagonal line on the matrix. Because the plot is
actually a trellis object, I am having difficulty working out how to
do this. I have been reading around, but I don't see any easy solution
to the problem. (Most of the docs I have
2008 Feb 22
1
abline in log-log power law plot
I have a power law plot in log-log scale using plot(x,y,log="xy") but I
can't get the regression line to plot correctly.
abline(lm(log(y)~log(x))) plots a straight line that looks promising but
the intercept with the y-axis seems to be way off.
summary(lm(log(y)~log(x))) gives the values but i cant really make any
sense out of it.
fitted(..) just confirms the values that seem to be
2008 Jun 27
1
xyplot and separate abline per plot
Hello list!
I have a set of data like this:
> alldata[1:5,]
breaks numbers disttype moltype type
1 0.0000000 6598 Gapped Distances 5S Between species
2 0.4066667 0 Gapped Distances 5S Between species
3 0.8133333 5228 Gapped Distances 5S Between species
4 1.2200000 0 Gapped Distances 5S Between species
5 1.6266667 9702 Gapped
2006 Jan 31
0
lattice: combining panel.xyplot with panel.abline - is thispossible?
Well, one way to do it is
xyplot(y~time|id, data=dat,type='l',
panel=function(x,y,subscripts,...){
panel.xyplot(x,y,subscripts,...)
panel.abline(v=dat[subscripts,"cm1"])
panel.abline(v=dat[subscripts,"cm2"])
}
)
Since I don't know what the dataframe 'mergeData' is I have used 'dat'.
Best regards
Frede Aakmann
2007 Jan 28
1
extra panel arguments to plot.nmGroupedData {nlme}
Greetings,
I have a groupedData (nmGroupedData) object created with the following syntax:
Soil <- groupedData(
ksat ~ conc | soil_id/sar/rep,
data=soil.data,
labels=list(x='Solution Concentration', y='Saturated Hydraulic Conductivity'),
units=list(x='(cmol_c)', y='(cm/s)')
)
the original data represents longitudinal observations in the form of:
2011 Jan 03
3
optimize
Hi all,
I'm trying to get the value of y when x=203 by using the intersect of
three curves. The horizontal curve does not meet with the
other two. How can I rectify the code below?
Thanks
Muhammad
ts <- 1:10
dd <- 10:1
ts <- seq(200,209,1)
dd <- c(NA,NA,NA,NA,1.87,1.83,1.86,NA,1.95,1.96)
plot(ts,dd,ylim=c(1.5,2))
abline(lm(dd~ts),col="blue",lty=2)
2005 Apr 12
2
abline() with xyplot()
Hello all,
I'm a new user on R, and I used the abline function to draw a line on my graph but it doesn't work with xyplot(). With the plot function, abline() is ok but with plot it doesn't make what I want. Maybe it's a little thing to change in plot() but I don't find what!
With xyplot I write this :
Xyplot(m~ordered(l,levels=1),
2013 Nov 19
2
como agrego una linea dibujada con abline() en la leyenda de un grafico ?
Eric
Recordé un ejemplo rápido
## Setup up coordinate system (with x == y aspect ratio):
plot(c(-2,3), c(-1,5), type = "n", xlab = "x", ylab = "y", asp = 1)
## the x- and y-axis, and an integer grid
abline(h = 0, v = 0, col = "gray60")
text(1,0, "abline( h = 0 )", col = "gray60", adj = c(0, -.1))
abline(h = -1:5, v = -2:3, col =
2006 Sep 04
1
abline and plot(augPred) help
Dear all
as I did not get any response on my post about abline and
plot(augPred)) I try again. I hope I do not break some posting guide
rules. I would try to contact package maintainer directly but there
is stated to be R-core people, so I feel R-help list shall be OK.
I need to draw straight lines through augPred plotted panels
(vertical or horizontal) at specified point. I know I shall
2006 Apr 13
1
panel.abline() and trellis.focus() on multipage plots
Hi,
I'm recently working on a multipage bwplot() using the lattice package. In
this context I was trying to use the panel.abline() function individually on
certain panels but not all. After some research I found the trellis.focus()
and trellis.unfocus() functions which enabled me to do something like:
trellis.focus("panel", 1, 3)
do.call("panel.abline", list
2008 Aug 07
2
panel.arrows problem in custom panel function
Dear List,
I am writing a custom panel function and xyplot method to plot the
results of a procrustes analysis from the vegan package.
I am having trouble getting the call to panel.arrows to work as I wish
when conditioning. The attached file contains the function definitions
for the xyplot method and the custom panel and prepanel functions I am
using. This example, using data and functions from