[R] automaticly adjust coordinates for text() labels
sergeyg at gmail.com
Wed Oct 17 12:43:02 CEST 2007
I have following problem.
I produce a histogram of some values and in the plot area I create 2
text boxes - one with names of statistics and one with values of these
statistics. Coded like that:
ht <-hist(x, ....)
ameant <-ameant <- paste("Ar.Mean")
amean <- round(mean(x), digits=2)
labels=c(ameant, amediant, mit, mat, stdevt, skewt, kurtt,
adt, jbt), pos=4, cex=0.7)
labels=c(amean, amedian, mi, ma, stdev, skew, kurt, ad, jb),
so, there are 9 lines, each consisting of a name (placement specified
with first text command) and a value (placement specified with second
The problem is, that when the x-axis values change, the second part
sometimes crashes into first one. I tried to automate the placement of
the second part by using ht$mids, but this still does not work when
the values on x-axis change.
Maybe someone has a clever suggestion for the automatic placement of
he second text part so that it is close to first part never crashes
into it, and looks something like this:
Thanks in advance!
More information about the R-help