Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

textxy

Nice placement of labels in a plot


Description

Function textxy calls function text in order to add text to points in a graph. textxy chooses a different position for the text depending on the quadrant. This tends to produces better readable plots, with labels fanning away from the origin.

Usage

textxy(X, Y, labs, m = c(0, 0), cex = 0.5, offset = 0.8, ...)

Arguments

X

x coordinates of a set of points

Y

y coordinates of a set of points

labs

labels to be placed next to the points

m

coordinates of the origin of the plot (default (0,0))

cex

character expansion factor

offset

controls the distance between the label and the point. A value of 0 will plot labels on top of the point. Larger values give larger separation between point and label. The default value is 0.8

...

additiona arguments for function text.

Value

NULL

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

References

Graffelman, J. (2006) A guide to biplot calibration.

See Also

Examples

x <- rnorm(50)
y <- rnorm(50)
plot(x,y,asp=1)
textxy(x,y,1:50,m=c(mean(x),mean(y)))

calibrate

Calibration of Scatterplot and Biplot Axes

v1.7.7
GPL-2
Authors
Jan Graffelman <jan.graffelman@upc.edu>
Initial release
2020-06-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.