search for: strheight

Displaying 20 results from an estimated 83 matches for "strheight".

2007 Nov 07
1
strwidth and strheight for rotated text
Dear All, I would like to plot text with a box around it. I used strwidth and strheight to compute the size of the box which is plotted with rect: z <- rnorm(10) # horizontal text works plot(rnorm(10)) x1 <- 5 y1 <- 0 label <- "Label" cha <- paste(" ", label, " ", sep = "") xh <- strwidth(cha, cex = par("cex")) yh &...
2000 Apr 18
1
strheight() crashes without opened device (PR#524)
My mistake, but also a bug. I did not open a device and called strheight("X"). ==> R crashed ...\rgui --vanilla [...] > strwidth("X") Error in strwidth("X") : plot.new has not been called yet (OK.) > strheight("X") R crashed. (Happens also on Solaris.) Regards, Uwe Ligges --please do not edit the information belo...
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 Dec 20
3
RE: [R] SAS or R software
Yes, par(family="mono") would work, except that I get R segfaults from this sequence: > > plot.new() > par(family="mono") > par(cex=8) > strheight("foo") Process R segmentation fault (core dumped) at Mon Dec 20 16:07:56 2004 on R 2.0.1 (2004-11-15), Red Hat Enterprise Linux AS release 3 In my code I call strheight and strwidth several times in order to find a cex that makes the text best fit the display area. Once the segfaulti...
2007 Jan 24
4
Text position in Traditional Graphics
R 2.4.1 on Windows XP. Question: In traditional graphics, is it possible to find out the height of a line of text in units that can be used in arithmetic and then in calls to text()? Context: I have written a function that draws a plot and then, depending on whether some arguments are TRUE or FALSE, draws various lines of text in the plot. The text lines may be turned on or off individually
2004 Sep 14
1
documentation error par("cin") and par("cra") (PR#7227)
Dear all, the help of par() claims that cin and cra are c(width, height) but it appears to be rather c(height, width) Best regards Jens Oehlschl?gel > plot.new() > strheight("W", unit="inches") [1] 0.1354167 > par("cin") [1] 0.1354167 0.1875000 > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor...
2008 Feb 21
1
linebreaks in mathplot
...t;*a*" %\n b ="*b*" km"*phantom()^2, list(a=a,b=b)) would do it. However it does not work. Is it possible to formulate "multi-line" expressions in plotmath? What is the trick? Or I should break txt into separate lines, and place the lines independently using text and strheight()? Thanks, B?lint -- > sessionInfo() R version 2.6.1 (2007-11-26) i386-pc-mingw32 locale: LC_COLLATE=Hungarian_Hungary.1250;LC_CTYPE=Hungarian_Hungary.1250;LC_MONETARY=Hungarian_Hungary.1250;LC_NUMERIC=C;LC_TIME=Hungarian_Hungary.1250 attached base packages: [1] grDevices graphics stats...
2010 Jul 22
5
legend in R plot
Hi all, I am have some difficulty with the legend function. I need to add a legend to describe the different line types in a plot. The legend box is small. It did not include sufficient length of each line type to help distinguish the differnt line types. Is there a way to fix this. Thank you Hannah [[alternative HTML version deleted]]
2005 Oct 07
2
Text in Boxes?
It's probably a beginner's question: How do I show text in boxes? That is, can I specify a background color for text output with text() ? The following doesn't work as I would expect: text(labels="123", 50, 0.5, bg="green") I've experimented with legend(),which will make the box too wide, and also with rect(), which doesn't know the extent of the text
2004 Dec 20
1
RE: [R] SAS or R software
...t 16:13 -0500, Warnes, Gregory R wrote: > > Yes, par(family="mono") would work, except that I get R > segfaults from this > > sequence: > > > > > > > > plot.new() > > > par(family="mono") > > > par(cex=8) > > > strheight("foo") > > > > Process R segmentation fault (core dumped) at Mon Dec 20 > 16:07:56 2004 > > > > on R 2.0.1 (2004-11-15), Red Hat Enterprise Linux AS release 3 > > > > In my code I call strheight and strwidth several times in > order to find...
2009 Jan 27
1
Plotmath and line breaks in long annotations for plots
I'm trying to combine multi-line text and math annotations on a plot and am not having much luck. I looked at various suggestions in the archives, but I cannot coerce any of them to do what I want. I'm beginning (finally?!) to think that there is an entirely better approach than the one I have tried. The essential problem is that line breaks (\n) don't seem to behave the way I
2000 Dec 28
0
some (may be related) problems with windows(rescale=) (PR#795)
...text(1,1,"abc\ndef", cex=2) > text(1,0.5,"fixed", cex=2) > temp <- t(sapply(par(c("din", "fin", "pin")),c)) > colnames(temp) <- c("x", "y") > temp <- rbind(temp, text=c(strwidth("abc\ndef", cex=2), strheight("abc\ndef", cex=2))) > fixed <- temp > > windows(width=width, height=height, rescale="fit") > par("cex") > plot(0:2,0:2, type="n") > text(1,1,"abc\ndef", cex=2) > text(1,0.5,"fit", cex=2) > temp <- t(sapply(p...
2004 Dec 20
1
mono fonts (was RE: RE: [R] SAS or R software)
...2004, Warnes, Gregory R wrote: > > > > > Yes, par(family="mono") would work, except that I get R > segfaults from this > > sequence: > > > >> > >> plot.new() > >> par(family="mono") > >> par(cex=8) > >> strheight("foo") > > > > Process R segmentation fault (core dumped) at Mon Dec 20 > 16:07:56 2004 > > > > on R 2.0.1 (2004-11-15), Red Hat Enterprise Linux AS release 3 > > > > In my code I call strheight and strwidth several times in > order to find a &g...
2000 Nov 08
1
Graphics-Device-Size vs. Window-Size
I want to layout on screen a graphic bigger than the screen (width=16.53543, height=11.69291) but strwidth() and strheight() give wrong results. > x11(width=42/2.54, height=29.7/2.54, pointsize=12) > plot(1,1, type="n", xlim=c(0, 1), ylim=c(-1, 0), xlab="", ylab="", axes=FALSE) > strwidth("Whatever") [1] 0.08471151 > # Now resize the window and repeat > strwidth(&...
2000 Nov 08
1
Graphics-Device-Size vs. Window-Size
I want to layout on screen a graphic bigger than the screen (width=16.53543, height=11.69291) but strwidth() and strheight() give wrong results. > x11(width=42/2.54, height=29.7/2.54, pointsize=12) > plot(1,1, type="n", xlim=c(0, 1), ylim=c(-1, 0), xlab="", ylab="", axes=FALSE) > strwidth("Whatever") [1] 0.08471151 > # Now resize the window and repeat > strwidth(&...
2000 Dec 28
1
some (may be related) problems with windows(rescale=) (PR#794)
...type="n") text(1,1,"abc\ndef", cex=2) text(1,0.5,"fixed", cex=2) temp <- t(sapply(par(c("din", "fin", "pin")),c)) colnames(temp) <- c("x", "y") temp <- rbind(temp, text=c(strwidth("abc\ndef", cex=2), strheight("abc\ndef", cex=2))) fixed <- temp windows(width=width, height=height, rescale="fit") par("cex") plot(0:2,0:2, type="n") text(1,1,"abc\ndef", cex=2) text(1,0.5,"fit", cex=2) temp <- t(sapply(par(c("din", "fin", &...
2007 Jul 26
1
How to auto-scale cex of y-axis labels in lattice dotplot?
...nif(26*reps)) dotplot(let~y|grp, dat) Is there a way to automatically scale the labels so that they are not over-plotted? I currently do something like this: Calculate or guess the number of panel rows: NumPanelRows cexLab <- min(1, .9*par()$pin[2]/ (nlevels(dat$let)*NumPanelRows*strheight("A",units="in"))) dotplot(..., scales=list(y=list(cex=cexLab)) Is there an easier way? Is there a function that I can call which calculates the layout of the panels that will be used in the dotplot? Any tips will be appreciated. K Wright
2005 Jun 11
1
Wishlist: strwidth allow for rotation of text (PR#7931)
Hi, This is not a bug, but an enhancement suggestion. "strwidth" only gives the width of the text according to the x-axis user coordinates, and similarly for "strheight". Even if the par setting "srt" is changed to rotate the text, the resulting width (resp. height) is in terms of the non-rotated text. Currently, if I want to know how much space to leave for vertical text in the user coordinates, I manually invert the user coordinates, and then...
2006 Mar 13
1
[R] dotchart: Gap between text and chart (PR#8681)
...d Gaststaettendienstleistungen", > "Andere Waren und Dienstleistungen")) > > dotchart(sort(a)) > dotchart(sort(a),cex=0.7) I've determined that this is a bug in dotchart. It miscalculates the height of a line of text in the right margin, using lheight <- strheight("M", "inch") which doesn't give the right answer. You get the correct answer in this case by putting lheight <- par("mai")[2]/par("mar")[2] but that's not a general solution, as the denominator may be zero. I'll look for a better soluti...
2010 Aug 18
3
mtext coordinates
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100818/5f203714/attachment.pl>