Displaying 20 results from an estimated 30000 matches similar to: "Using strwidth before plotting"
2004 Oct 17
2
Plotcorr: colour the ellipses to emphasize the differences
Hello R users!
I began with R and I must say that it is really nice. I have data with a lot of variables
and have a problem to extract the pattern from correlation matrix. So I tried with plotcorr
and it went fine. While I was reading the help page of this function, I found that ellipse
display can be even better with use of different colors (the code is bellow). However I have
a problem to
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 Aug 14
1
strwidth
Dear plotting experts,
I need to determine the width of a string before plotting it to the
current device because I want to adjust `mai' to have
the necessary space available. It seems to me that this is an "hen and
egg" problem:
R> a <- "test"
R> strwidth(a)
Error in strwidth(a) : plot.new has not been called yet
# ok, I need an open device
R> plot(1:2,
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 <-
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
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
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 =
2005 Sep 09
1
Plotting an ellipse in 3D
I have been using the ellipse function from the car package and the
covariance matrix to draw an ellipse around a group of points to show the
confidence limits. However, the points are actually represented by 3
variables so rather than plot each pairwise combination of variables in 2D I
would like to plot the 'ellipse' in 3D using the djmrgl package. Can anyone
offer advice on how I can
2008 Apr 13
1
plotting muliple CI ellipses for EB estimates
I have empirical Bayes estimates for slopes and intercepts for a number of
subjects and I would like to plot the slopes and intercepts with confidence
ellipses. These ellipses would be based on the confidence intervals for the
slope and intercepts (forming the major and minor axis of each ellipse), and
the correlation in the slope and intercepts.
The ellipse function in the car library
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
2011 Aug 10
1
Plotting Ellipses and Points of Matching Colors in an Ordination
Hello, R-Help -
I am trying to plot the results of an ordination from package vegan. The
tricky part for me right now is getting the colors of the ellipses denoting
the 95% confidence intervals of the group centroids to match the colors of
the points for those same groups.
>From and earlier post, I saw the code to make a plot of the ordination using
different colors for my different groups.
2006 Sep 21
1
plot correlation matrix
Dear useRs,
While exploring new R packages, I have found the Rattle.
This screenshot http://rattle.togaware.com/rattle-correlation.png
is very interesting
(others are in http://rattle.togaware.com/rattle-screenshots.html ).
Which function was used to produce this plot?
Is such plotting of the correlation matrix a unique Rattle's feature?
Unfortunately I have some weird problems with RGtk2
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
2007 Sep 24
2
calculating/plotting error ellipses
hello,
sorry for posting what may be a simple question:
i do have a matrix of coordinates (positional judgments, see below) and
now want to calculate and plot the corresponding error ellipse.
can anyone help me with the exact steps/syntax?
> xyDat
X Y
1 -0.49 -2.13
2 0.91 0.48
3 0.20 -2.80
4 -0.76 -3.23
5 -0.36 2.50
6 1.38 1.24
7
2011 Feb 11
1
How to compute "yaxp" and "usr" without plotting ?
Dear all,
I'd like to know how I could compute the parameters "yaxp" and (the y
components of) "usr" without having to plot the data first. Note that
"ylim" is /a priori/ fixed.
The aim is to automatically adjust the parameter "mgp" without having to
make the plot twice. Then, with "yaxp" and "usr" known, it should be
easy to
2000 Jan 04
1
Alternative to cxy in R
good morning to the R-help list!,
I would like to ask if there is an alternative to the S ploting
parameter "cxy" in R. I am trying to port some S code to R that makes use
of this "cxy" parameter to scale the graphics, and I don't find this
parameter in help(par).
thank you,
IOsu
-------------------------------------------------------------------------------
Jes?s
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
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