Displaying 20 results from an estimated 8000 matches similar to: "strwidth"
2004 Nov 20
1
Error with strwidth after lattice graphic drawn
In
platform i386-pc-linux-gnu
arch i386
os linux-gnu
system i386, linux-gnu
status
major 2
minor 0.1
year 2004
month 11
day 15
language R
I'm getting an error when using strwidth after a lattice graphic is drawn:
library(lattice)
xyplot(runif(20) ~ runif(20))
strwidth('xxx')
Error in strwidth("xxx") : invalid graphics state
Any help
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 <-
2008 Jun 30
2
Plotting question: Problem with strwidth in 2.7.1
R users,
I have a problem with function strwidth in 2.7.1. I'm trying to set
the plot margins in a way that horizontal
column labels will fit to the graph. tmp.t is a list of data.frame
objects. This code works well in 2.6.0.
...snip..
library(gplots)
for (i in names(tmp.t)) {
bmp(filename=paste(i, "_", Sys.Date(), ".bmp", sep=""),
width=1038,
2007 Oct 30
3
strwidth of bold font
Hi!
Is there a way to get the string width of the bold typefaces?
like: strwidth("text", family = "serif", font = 2).
Thanks
Roland
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
2009 Jan 05
1
strwidth to lines
Dear members,
Is there a way to turn a strwidth of a string into a number of lines
that ist needed to display the string when using par(mar = c(?,4,4,2))
####
x = 1:5
names(x) = c("ZZZZZ","ZZZZZzzzzz","ZZZlllll","TTTTT","Zzhtsddfg" )
par(mfrow = c(1,2))
par(mar = c(8,4,4,2))
barplot(x, las = 3, main = "8 is to much")
par(mar =
2004 Mar 12
1
plot.dendrogram and expressions
Hi,
currently the "label" and "edgetext" attributes of a dendrogram are
coerced to character before they are added to a plot with `text'. Is there
a specific reason to do so (expect for the determination of the size of
the character string to be plotted)? Otherwise one could plot the
attributes directly via
diff dendrogram.R /usr/src/R/src/library/stats/R/dendrogram.R
2002 Apr 17
1
Using strwidth before plotting
In the plotcorr() function in the ellipse package, I want to position
things differently depending on the size of the labels. I can use
strwidth to find out the length of the labels, but only when there's a
plot window open: it won't open one.
Question: What function call says: make sure there's a window open
(i.e. do what plot() does before it starts plotting)?
I don't think
2002 Sep 03
1
Properly initializing a plot
I have many functions for high-level plotting that early on in their code do something like strwidth('string', units='inches') before plotting. I do this before plot() to set the correct margins with par(mai=...), to leave room for wide text on the left or right margins.
If the plotting device is not opened strwidth( ) causes an error that plot.new() needs to be called. I can
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
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
2019 Feb 05
2
[DebugInfo][DIBuilder] Good way to pass arguments to createClassType/createMemberType
Hi,
I'm trying to use DIBuilder to build my debug info and export it into a
PDB, but I don't understand the way some DIBuilder method work.
My question might have a straightforward answer but I don't see it ... (and
I can't find any example code using these methods anywhere).
Indeed createClassType takes an "Elements" argument, and createMemberType
takes a
2011 Aug 12
1
Grid unit width and font face
Dear R-users,
When one defines a grid unit object using the 'strwidth' dimension, it
seems that the default plain font is assumed as the following example
illustrates. Is there a way to either make use of a font option when
creating a unit object or to know the factor that exists between the
width of the same text printed in plain and in bold? This might be
dependent on the font,
2007 Aug 14
1
{grid} plain units with non NULL data arguments
In help(unit) I read:
The 'data' argument must be a list when the 'unit.length()'
is greater than 1. For example, 'unit(rep(1, 3), c("npc",
"strwidth", "inches"), data=list(NULL, "my string", NULL))'.
In the newest R-versions it is not anymore allowed to let strings
in the data-argument for plain units, otherwise one
2010 Apr 15
2
graphic question
Hello,
I have a simple question that I could not really figure out. I am plotting labels within a graph using the text function. I first plot the first label by specifying the x and y coordinates on the graph. Then to plot the second label next to it, I am using te strwidth function to get the width of the previous label in user coordinate then add the maximum width to the x value. However, this
2007 Oct 31
1
textplot() in gplots causes problems (0x9)
Hello,
I am using textplot function in gplots package to put some model
output inside a PDF file, but it does not seem to work properly with
PDF.
I am doing follwing:
pdf(file="C:/...", paper="a4", width=8, height=12)
.model <- lm(.model.formula, data=database)
textplot(capture.output(summary(.model)), valign="top", halign="left")
I am getting these
2005 Jun 01
1
panel.axis() & grid/lattice settings
Hello,
I wish to customize the tick marks and labels of axes in panels produced by
high-level lattice functions, namely xyplot. I know I can use the scales
argument to specify values for rot, cex, etc. in the top-level call.
However, I am interested in determining values for cex and rot based on the
current panel / viewport and device. More specifically, I would like to make
adjustments when
2002 Dec 09
2
APL?
Hi,
is anybody out there who knows APL and would help me to translate 52
lines of APL code into propper R?
best,
Torsten
2004 Mar 03
2
read.spss and time/date information
I don't use SPSS but following through on your detective work
can provide the likely answer.
First note that both date numbers are evenly divisible by the number
of seconds in a day, i.e. 24*60*60. This suggests that these numbers
are seconds since some origin.
Since we know "2003/02/11" corresponds to 13264300800 we deduce that
the origin must be
spss.orig <-
2000 Nov 09
1
RE: [R] Graphics-Device-Size vs. Window-Size
Hi Paul,
thank you for responding. I indeed overlooked, that units="inch" gives
stable results, independent of resizing the graphics window on the screen.
And indeed I would find some way fiddling around to get my graphic done.
However I see a general problem here and I would like a general solution:
Obviously we are dealing with two coordinate systems: the graphics device
size (call