Skip to content
Prev 245374 / 398502 Next

barplot: width of label

On Dec 19, 2010, at 10:55 AM, Peter Ehlers wrote:

            
^
Anyone pasting this code should insert the missing single-quote.
Another option is to insert \n's.

x <- c(12, 33, 56, 67, 15, 66)
names(x) <- c('Richard\n with a\n long \nsurname','Minnie\nwith a 
\nlong \n name','Albert','Helen','Joe','Kingston')
  barplot(x)
And yet another option, somewhat more complex, would be to construct  
an x- axis with slanting labels. (Several worked examples posting in  
the archives.)