Skip to content
Prev 172339 / 398506 Next

vertically aligned X axis labels disappear off R Graphics window

On Wed, Feb 25, 2009 at 12:51 PM, Uwe Ligges
<ligges at statistik.tu-dortmund.de> wrote:
Been there, did that :)

Run these steps. Run the par with various values to change margins.

The size of the figure is fixed from the outside edges, so when you
make the margin bigger, the drawing gets squeezed.

x <- rpois(14, lambda=10)

mynames <- c("Really Long Name","Really Long Name","Really Long
Name","Really Long Name","Really Long Name","Really Long Name","Really
Long Name","Really Long Name","Really Long Name","Really Long
Name","Really Long Name","Really Long Name","Really Long Name","Really
Long Name Long Long")


barplot(x, names=mynames, las=2)


## RSiteSearch("barplot names margins")

barplot(x, names=abbreviate(mynames), las=2)

par(mar=c(9.5,3,0.5, 0.3))
barplot(x, names=mynames, las=2)


## believe should be same as following, but the following works
## to change the margin only once, and further calls
## to similar have no margin changing effect. So
## you need run par over again before boxplotting.

barplot(x, names=mynames, las=2, mar=c(9.5,3,0.5, 0.3))