search for: ltext

Displaying 20 results from an estimated 78 matches for "ltext".

Did you mean: text
2005 Nov 10
2
ltext - adding text to each panel from a matrix
Hi all (really probably just Deepayan): In the plot below I want to add text on either side of each violin plot that indicates the number of observations that are either positive or negative. I'm trying to do this with ltext() and I've also monkeyed about with panel.text(). The code below is generally what I want but my calls to ltext() are wrong and I'm not sure how to fix them. Right now they replicate the first column of the matrices obs.pos and obs.neg for each panel. How do I tell ltext to advance to the n...
2004 Jan 27
1
ltext( pos=NULL )
ltext( 0, 0, pos=NULL, label="xxxx") gives an error message. The help page of ``ltext'' references to the help page of ``text'' where the default value of pos is set to NULL. To solve the problem ``ltext'' could be changed: OLD: if (!missing(pos)) NEW: if (!mis...
2010 Jan 24
1
lattice ltext
Dear friends - please give me a hand. I have a dataset of 40 patients in two groups observed on three occasions. I only want to plot a line for each patient in the two groups. I use the ltext function to put the patient number but fail to make lattice understand the numbers as unique since apparently it starts all over with 1:20 for each panel instead of respecting my desires to have 1:20 and then 21:40. I'm on windows vista, R2.9.2 Best wishes Troels score <- runif(120,0,...
2006 Jul 19
2
trellis.focus with postscript device
...lt;- c(1:20,1:35,1:30,1:20,1:4,1:10) gg <- rep(c('A','B','A','B','A','B'), c(20,35,30,20,4,10)) pp <- rep(c('Cond 1','Cond 2','Cond 3'), c(55, 50, 14)) xyplot(yy ~ xx | pp, groups=gg) trellis.focus('strip', 1, 1) ltext(0,.5,'20',col='red', pos=4) ltext(1,.5,'35',col='black', pos=2) trellis.unfocus() trellis.focus('strip', 2, 1) ltext(0,.5,'30',col='red', pos=4) ltext(1,.5,'20',col='black', pos=2) trellis.unfocus() trellis.focus('strip'...
2004 Apr 14
1
ltext, plotmath, and substitute
...p(1:4, each=4), time = rep(1:4, 4), das = rnorm(16)) # plot regression lines and print equations xyplot(das ~ time | as.factor(id), data = tmp.df, strip = T, panel = function(x,y,...){ panel.coef <- round(coef(lm(y~x)), 2) panel.grid() panel.xyplot(x,y) panel.lmline(x,y) ltext(1.2, 1, pos = 4, paste("Y = ",panel.coef[1]," + ",panel.coef[2],"*time", sep = ""), cex = 1.2) }, layout = c(4,1,1), aspect = 2.5) The above works fine. However, I'd like to make the equations more attractive by adding a hat over Y and a...
2009 Oct 30
1
insert a text in panels, always in the same position (lattice, ltext, ?prepanel?)
...ere below. I'm able to write the value in each panel at the maximum value of y for each panel, but this obviously overlay the text to the points. What I'm looking for is to write the text always in the same position along the panels, say in the middle of each panel something like "ltext(x = 1.5, y = (ylim[2] - ylim[1])/2 )" I tried to play with "ylim" and prepanel but unsuccesfully. Thank a lot in advance ################################################################################# df <- expand.grid(a = gl(3,1), b = gl(2,1),...
2002 Feb 15
1
latex in ltext
Hi. I have been able to get things like text(9,46, expression(hat(beta) == (X^t * X)^{-1} * X^t * y)) to work in regular plots but ltext(9,46, expression(hat(beta) == (X^t * X)^{-1} * X^t * y)) does not do the same in lattice (trellis) plots. Has it not been implemented or am I missing something? Thanks - Mary -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.c...
2009 Nov 23
3
Trellis Plot
anyone know how to add text in the Trellis plot panel ?? i want to add things eg: dot dot dot. in the headrer of the panel. eg: http://old.nabble.com/file/p26486579/hist1.png hist1.png -- View this message in context: http://old.nabble.com/Trellis-Plot-tp26486579p26486579.html Sent from the R help mailing list archive at Nabble.com.
2007 Dec 09
1
Saving lattice plot as a PDF
...ding=list(x=0.15, units="inches"))) print(plot1, split=c(1,1,2,3), more=TRUE) print(plot2, split=c(1,2,2,3), more=TRUE) print(plot3, split=c(1,3,2,3), more=TRUE) print(plot4, split=c(2,1,2,3), more=TRUE) print(plot5, split=c(2,2,2,3), more=TRUE) print(plot6, split=c(2,3,2,3), more=FALSE) ltext(grid.locator(), label='text', cex=1.3) ltext(grid.locator(), label='text', cex=1.3) And when I open the PDF created I see "text" at the bottom of may layout, even though I placed it at the top of the sheet.. If I save it as a metafile of PNG the layoout is correct. I hav...
2010 Apr 01
2
How to get the scale limits in lattice plot
I am drawing a density histogram, and want to label the plots with the mean using ltext(). But I need the x,y coordinates to feed into ltext, and I can't calculate them easily from my data. Is there a way to get the x and y ranges being used for the plot, so I can put the text at the correct position in the panel.function? Thanks, Jim Rome
2002 Apr 23
1
Writing text in lattice graphics
...39;m trying to obtain a set of regression lines obtained for different values of a factor using lattice. I would like to add a string to each panel showing the R^2 value of the respective line, but I'm having difficulties positioning the text (namely on which coordinates to give to the "ltext" function). Here is what I'm using (I've used ?? for the things I would like you to be so kind to help me on how to fill in). > xyplot(O2 ~ Am | Site, data = mydata, scales=list(x='free'), panel=function(x,y,...) { panel.xyplot(x,y,...) panel.lmline(x,y,...) ltext(...
2005 Feb 15
1
lattice multiple plots per page
...labels print(a,position=c(0.1,0.1,1,1),split=c(1,1,2,2),more=T) print(a,position=c(0.1,0.1,1,1),split=c(1,2,2,2),more=T) print(a,position=c(0.1,0.1,1,1),split=c(2,1,2,2),more=T) print(a,position=c(0.1,0.1,1,1),split=c(2,2,2,2),more=F) #commands that let you click where you want the labels centered ltext(grid::grid.locator(),lab="x-axis label, where I click",cex=1.5) ltext(grid::grid.locator(),lab="y-axis label, where I click",cex=1.5,srt=90) #save device to an *.eps file, to be called later by a \includegraphics command dev.copy2eps(file="twobytwoplot.eps") -------...
2003 Oct 27
1
How can strheight be calculated in lattice/grid?
If I have drawn a string with ``ltext( x, y, labels="first string" )'' how can a draw a second string just one line (or strheight("X") below the first string regardless of the size and scales of the panel? Thanks Wolfram
2004 Apr 13
1
lattice problem in R-1.9.0
...a script that looked like: library(lattice) tmp <- expand.grid(A = 1:3, B = letters[1:2]) tmp$z <- runif(NROW(tmp)) trellis.device(png, file = "x1081.png", theme = col.whitebg) xyplot(z ~ A | B, data = tmp, panel = function(x, y, i) { panel.xyplot(x, y) ltext(1, 0.95, paste("i =", i), adj = 0) }, ylim = c(0, 1), i = 10) dev.off() In R-1.9.0, the same script gives the following error message: Error in trellis.skeleton(cond = structure(list(B = structure(as.integer(c(1, : Invalid value of index.cond I've tracked...
2011 Jan 21
1
Help for lattice. par(new=TRUE)
Hi list, I want to plot two plot in the same figure. I set par(new=TRUE). But it does not work. library(lattice) myPanel <- function(x,...) { panel.histogram(x,alpha=0.4,...) ltext(0.4,1.5,paste("Mean=","0.05",digit=2)),cex=0.8) ltext(0.8,1.5,paste("s.d.=","0.06",digit=2)),cex=0.8) } histogram(sh2, type="percent",panel=myPanel,breaks=seq(0,1,by=0.01),ylim=c(0,5),col=rgb(0.1,0.1,0.8,0.5)) par(new=TRUE) #### Here is does...
2010 Jul 05
4
Data Labels in a barchart (Lattice or otherwise)
Hi, Can anyone please help me with how I could add labels with the value for each bar in a barchart? (similar to how data labels can be added in Excel) I have done a lot of searching but havent been lucky. Thanks, Raoul -- View this message in context: http://r.789695.n4.nabble.com/Data-Labels-in-a-barchart-Lattice-or-otherwise-tp2278027p2278027.html Sent from the R help mailing list archive at
2008 Nov 10
4
Labeling points with xYplot
..., second tries to label the points and the bars disappear. Thanks, John a=c(1:4) b=rnorm(4,15,5) blab=b+1 xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3)) xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3), panel=function(x,y,...){ panel.xyplot(x,y,...) ltext(x=list(1,2,3,4), y=list(13,14,15,16), labels=list("A","B","C","D"), pos=2)})
2007 Dec 09
1
Adding text outside lattice plot
Hello, I need to add some text in the upper left position, outside a lattice plot. xyplot(x~y) ltext(locator(1), label='My text') doesn't work. I would appreciate any help. Tahnk you, Judith ____________________________________________________________________________________ Be a better friend, newshound, and
2008 May 30
1
Question about adding text to xYplot(Hmisc)
...(dfr, y=month/10 + 1*(sex=='female') + 2*(continent=='Europe') + runif(48,-.15,.15), lower=y - runif(48,.05,.15), upper=y + runif(48,.05,.15)) myPanel <- function(x, y, subscripts, ...) { panel.xYplot(x, y, ...) ltext(x, 3, letters[subscripts], cex=0.5) } xYplot(Cbind(y,lower,upper) ~ month,subset=sex=='male' & continent=='USA', data=dfr, panel = myPanel)
2003 Jul 21
1
Lattice: how to draw some text outside the panel?
Dear r-help I draw plots with xyplot() function. Each plot contains also a line of regression. I want to write the trend value and its significance (obtained with lm()) below each panel. I use ltext() for this. But the text is cut, when it comes outside a panel. Moreover (obviously), it doesn't appear at all when its coordinates are outside a panel. Could you, please, be so kind to give me a direction to walk in order to have a text written below a panel. Thank you! --...