axis.srt: axis.srt Extend generic axis() function with rotation of...

View source: R/common.R

axis.srtR Documentation

axis.srt Extend generic axis() function with rotation of labels (string rotation, srt). If labels on the x-axis are parallel, then they are center justified; otherwise they are right-justified.

Description

axis.srt Extend generic axis() function with rotation of labels (string rotation, srt). If labels on the x-axis are parallel, then they are center justified; otherwise they are right-justified.

Usage

axis.srt(side, at, labels, srt, offset = 0.05, cex = 1, ...)

Arguments

side:

an integer specifying which side of the plot the axis is placed as follows: 1=below, 2=left, 3=above and 4=right.

at:

the points at which tick-marks are to bve drawn.

labels:

a character vector of labels.

srt:

string rotation in degrees, where 0 is horizontal

offset:

distance to draw labels relative to axis, scaled to dimensions of plot region.

cex:

character expansion factor for axis labels

...:

other arguments passed to axis(), *e.g.*, 'line' or 'col'

Examples

par(mar=c(5,5,5,5), xpd=FALSE)
boxplot(split(iris$Sepal.Length, iris$Species), xaxt='n')
axis.srt(side=1, at=1:3, labels=levels(iris$Species), srt=30)
axis.srt(side=3, at=1:3, labels=levels(iris$Species), srt=-30)
# draw horizontally instead
boxplot(split(iris$Petal.Length, iris$Species), horizontal=TRUE, yaxt='n')
axis.srt(side=2, at=1:3, labels=levels(iris$Species), srt=-30)
axis.srt(side=4, at=1:3, labels=levels(iris$Species), srt=30)


ArtPoon/ggfree documentation built on July 11, 2024, 11:15 a.m.