search for: convertwidth

Displaying 4 results from an estimated 4 matches for "convertwidth".

2004 Apr 09
1
R-1.9.0 beta: vignettes for package grid
...a on Windows NT 4.0. Uwe Ligges ==================================================== building/updating vignettes for package 'grid' ... Warning messages: 1: 'viewport.transform' is deprecated. Use 'current.transform' instead. See help("Deprecated") 2: 'grid.convertWidth' is deprecated. Use 'convertWidth' instead. See help("Deprecated") 3: 'grid.convertHeight' is deprecated. Use 'convertHeight' instead. See help("Deprecated") Error: chunk 12 Error in c(0, 0, 1) %*% transform : requires numeric matrix/vector arguments...
2007 Mar 25
1
controlling panel.width and panel.height in viewports
...ALSE) I want to get rid of the space (margins) around the longest axis for each variety of levelplot. So I tried to capture the viewport height and width and print the levelplot within a region which reflects the aspect ratio of the plot. I run into an error message as below: width.vp <- convertWidth(grobWidth(grid.rect()), 'cm') height.vp <- convertWidth(grobHeight(grid.rect()), 'cm') width.vp;height.vp # this works if(asp.ratio.1 < 1) {height.vp <- unit(as.numeric(height.vp)*asp.ratio.1, "cm")} if(asp.ratio.1 > 1) {width.vp <- unit(as.numeric(width....
2011 Aug 03
0
How to calculate the number of times a given string can be displayed in the width of a grid viewport
...idth of the viewport), this solution seems a bit overworked. Any suggestion would be welcome. Sebastien require(grid) dev.off() dev.new() nstr <- '' str <- 'OXXXX' nInWidth <- floor(unit(1,'npc')/unit(1,'strwidth',str)) # Does not work nInWidth <- 0 convertWidth(unit(1,'strwidth',nstr),'npc') while (unclass(convertWidth(unit(1,'strwidth',paste(nstr,str,sep='')),'npc'))[1] - 1 <=.Machine$double.eps){ nInWidth <- nInWidth +1 nstr <- paste(nstr,str,sep='') } nInWidth grid.text(paste(rep(str,nInWi...
2004 Jun 28
1
text length in grid
Hello! I first would like to compliment the authors of grid on what has been a wonderfully useful package for me. Now, my question: Is there any way I can specify the size of some grid.text using grid units? I must label the regions of a plot. The regions can be either very small or very large, so I would like to label each by fitting its text to the size of the region in question. Ideally, I