Re: [R] vertically aligned X axis labels disappear off R Graphics window

From: Paul Johnson <pauljohn32_at_gmail.com>
Date: Tue, 03 Mar 2009 01:41:00 -0600

On Wed, Feb 25, 2009 at 12:51 PM, Uwe Ligges <ligges_at_statistik.tu-dortmund.de> wrote:
>
>
> R User R User wrote:
>>
>> Hi guys,
>> I'm evaluating R for basic data exploration. I produce a bar plot of the
>> data, with the x axis labels aligned vertically. However, the start of
>> labels longer than about 10 characters are cut off by the bottom of the
>> graphics window.
>>

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))

-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 03 Mar 2009 - 06:47:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 03 Mar 2009 - 07:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive