[R] Label Rotation when Plotting with Factors

mwittmann at bren.ucsb.edu mwittmann at bren.ucsb.edu
Mon Apr 28 02:15:42 CEST 2008


Hello, 

Sorry if this is a repeat, having trouble finding what I need on archive and am
a novice with graphics in R! 

I have plotted the results of a logit regression by factor, where "city" is the
factor set name. The problem is city names are too long and I need to rotate
them 90 degrees along the xaxis. This is what I've tried... 

plot(city, predicted.probability, xlab = "city"...)
axis(1,las = 2)

This does not affect the existing labels. 

I have also tried (axes=FALSE), and then rename new with (labels = "Denver",
etc. ), but it seems as though I need to maintain the factor identities, as it
give me the error: 'labels' is supplied and not 'at'

Any suggestions? 

Thank you, 

marion wittmann



More information about the R-help mailing list