[R] y axis text truncated

paul sorenson sourceforge at metrak.com
Wed Jan 18 12:20:55 CET 2006


I have been trying to find which par settings can help me avoid 
truncated text at the bottom of the y axis in a mosaic plot (created 
when I plot a result of a 2d xtabs) without much success.  Using las=1 
has helped but the text (the "500+" level) is still cropped.

I get the same result on XP/2.2.0 and FC4/2.2.1.

Any tips would be appreciated.

# dput(foo.df)
 > foo.df = structure(list(vol1 = structure(c(1, 2, 3, 4, 5, 6, 1, 2, 3,
4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6
), .Label = c("<100", "101-250", "251-500", "501-750", "751-1000",
"1000+"), class = "factor"), vol2 = structure(c(1, 1, 1, 1, 1,
1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5,
5, 5, 5, 5), .Label = c("<20", "20-50", "50-100", "100-500",
"500+"), class = "factor"), Freq = c(4, 3, 0, 0, 2, 0, 4, 3,
6, 4, 1, 2, 1, 3, 3, 4, 5, 2, 3, 1, 3, 2, 2, 12, 0, 0, 1, 0,
2, 4)), .Names = c("vol1", "vol2", "Freq"), row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24",
"25", "26", "27", "28", "29", "30"), class = "data.frame")

 > xtabs(Freq ~ vol1 + vol2, data=foo.df)
           vol2
vol1       <20 20-50 50-100 100-500 500+
   <100       4     4      1       3    0
   101-250    3     3      3       1    0
   251-500    0     6      3       3    1
   501-750    0     4      4       2    0
   751-1000   2     1      5       2    2
   1000+      0     2      2      12    4

 > plot(xtabs(Freq ~ vol1 + vol2, data=foo.df))
 > plot(xtabs(Freq ~ vol1 + vol2, data=foo.df), las=1)




More information about the R-help mailing list