Skip to content
Prev 180531 / 398506 Next

Rotating x-axis categorical labels

On May 15, 2009, at 12:18 PM, Bill Hudspeth wrote:

            
par("las") takes 4 values 0:3. See ?par

Try:

   # Rotate both x and y
   barplot(1:5, names.arg = paste("Bar", 1:5), las = 2)

   # Rotate just x
   barplot(1:5, names.arg = paste("Bar", 1:5), las = 3)


If you want something other than a 90 degree rotation, see:

   http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f

HTH,

Marc Schwartz