similar to: {grid} plain units with non NULL data arguments

Displaying 20 results from an estimated 8000 matches similar to: "{grid} plain units with non NULL data arguments"

2008 Apr 11
3
strsplit and sapply
Colleagues, I have some text: TEXT <- c("a", "bb;ccc", "dddd;eeeee;ffffff") I want to retrieve the portion of each element before the first semicolon. I can split each element using strsplit: SPLIT <- strsplit(TEXT, ";") This yields: > SPLIT [[1]] [1] "a" [[2]] [1] "bb" "ccc" [[3]] [1] "dddd"
2011 Aug 03
0
How to calculate the number of times a given string can be displayed in the width of a grid viewport
There was too many spelling mistakes in my original post so I have decided to re-submit it. So here is it Dear R users, I am trying to determine how many characters can be displayed within the width of an open grid viewport. Unfortunately, the arithmetic operation that seems obvious in this case is not permitted with unit objects (see example below). Although there is a brute force way to get
2003 Oct 29
1
grid: dividing units by numbers
How can I divide a unit by an number or average a vector of units, e.g.: u1 <- unit( 3, 'npc' ) u2 <- unit( 6, 'npc' ) u1 / 2 ( u1 + u2 ) / 2 mean( unit.c(u1,u2) ) I would use that e.g. to to calculate the coordinates of the midpoint of a line. Wolfram
2007 Sep 02
2
Different behavior of mtext
Dear R Users, I am quite surprised to see that mtext gives different results when it is used with 'pairs' and with "plot'. In the two following codes, it seems that the 'at' argument in mtext doesn't consider the same unit system. I would appreciate your comments on this issue. Sebastien ##### Pairs mydata<-data.frame(x=1:10,y=1:10) par(cex.main=1,
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
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,
2005 Jul 19
2
segfault with grid and null unit (PR#8014)
Full_Name: Jonathan Paisley Version: 2.1.1 OS: Mac OS X 10.4.2 Submission from: (NULL) (81.178.107.67) I was following an example from library/grid/doc/grid.pdf ("Introduction to grid") and had the following code, where I'd mis-typed 1,3 instead of 1,2 as the first arguments to grid.layout. Sourcing this code causes the R GUI to crash. I've enclosed a partial backtrace from
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
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,
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
2007 Jul 24
1
How to add circular text for a graph with concentric circles
Dear R experts, I am plotting the population of students who live in a city, and in successive circular bands made of the contiguous districts that surround the city. This is a stylized figure, where I specify the area of each successive circle based on the cumulative population of students. I want to compare two sets of concentric circles across different populations - such as 'All
2010 Mar 27
1
string width calculation
Colleagues, I am trying to create a PDF document in which I use margin text with two different fonts. The resulting text might be: XXXXXyZZZ where X and Z are one font and Y is the other. My plan was to do this in the following manner: mtext("XXXXX ZZZ", cex=2, adj=0.5, family=SOMEFONT) mtext("Y", cex=2, adj=??, family=DIFFERENTFONT) My question regards how to calculate
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
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 <-
2011 Mar 04
1
Units and dimensions in grid object
Dear R-users, As far as I understand, when one defines the width of a rectGrob call using a 'npc' unit, the width of the object is proportional to the width of the current viewport. Is there a way to refer to the height (or width) of the viewport when defining the width (or height) of the rectGrob object? Thanks Sebastien [[alternative HTML version deleted]]
2005 Jun 02
0
Thanks! (was panel.axis() & grid/lattice settings)
Deepayan, Paul: Thanks very much for the very useful leads. I just spent some time this afternoon implementing your suggestions and my early test results are very encouraging. Paul, I understand the potential device re-sizing issue with the convert family of functions in grid, and will be in touch in case it becomes problematic for my applications. I very much look forward to your upcoming
2010 Feb 22
1
grid unit bug? (PR#14220)
The following seems to me to be at least a perverse trap, if not an = outright bug: > is.numeric(unit(1,"npc")) [1] TRUE > is.numeric(1*unit(1,"npc")) [1] FALSE > is.numeric(unit(0,"npc") +unit(1,"npc")) [1] FALSE ...etc. i.e. is.numeric() appears to be TRUE for class "unit" but false for = class ("unit.arithmetic"
2000 Dec 28
1
some (may be related) problems with windows(rescale=) (PR#794)
############################################################################### Before reporting 4 problems with windows(rescale=) I want to congrat on R1.2 and to thank r-developers for quickly adding the rescale workaround to the windows version. Happy New Year Jens Oehlschlaegel ###############################################################################
2011 Nov 10
1
grid.pack and grid.frame bewilder me
Hello R friends, I get quite confused in using the grid graphic function grid.pack( ) and grid.frame ( ). Here is a simple example: library(grid) grid.frame(name="frame1") grid.pack("frame1",rectGrob(width=unit(0.5,"npc"), height=unit(0.5,"npc"), gp=gpar(col="red"))) what I expect is a rectangle with half the default device's