[R] barplot3d cutting off labels

David Winsemius dwinsemius at comcast.net
Sat Nov 13 23:51:26 CET 2010


On Nov 13, 2010, at 5:11 PM, emorway wrote:

>
> Hello,
>
> Using the function that is available at:
>
> http://addictedtor.free.fr/graphiques/sources/source_161.R
>
> The following command leads to a plot with labels that are cut off:
>
> barplot3d(c(4.01,4.71,2.03,1.28,1.42,1.76,0,
>            6.58,3.25,3.11,2.10,2.05,1.19,1.28,
>            6.44,5.50,3.69,4.53,3.33,1.70,2.57,
>            6.01,5.36,5.90,6.61,4.67,2.62,3.83,
>            10.69,5.90,5.62,6.64,5.71,5.35,3.18,
>            8.98,7.30,7.73,7.23,14.10,8.65,4.00,
>            13.39,10.91,5.57,7.34,6.03,5.44,3.24),
>     rows=7, theta = 55, phi = 22, expand=0.9,
>     col.lab=c("GWTD < 1","1 <= GWTD < 2","2 <= GWTD < 3","3 <= GWTD  
> < 4","4
> <= GWTD < 5","5 <= GWTD < 6","GWTD > 6"),
>     row.lab=c("GW ECe < 1","1 <= GW ECe < 2","2 <= GW ECe < 3","3 <=  
> GW ECe
> < 4","4 <= GW ECe < 5","5 <= GW ECe < 6","GW ECe > 6"),
>
> col 
> .bar 
> = 
> c 
> ("#FF6633 
> ","#FFFF33","#99CCFF","#9933FF","#44ff58","#CCFFFF","#FF6666"),
>     z.lab="Soil ECe")
>
> I've also tried to use par(mar=c(5,5,5,5)) or par(oma=c(5,5,5,5)),  
> but to no
> avail.  Any ideas?

Your labels are being cut off because the plotting is being clipped to  
within the plot region.

First:
par(mar=c(5, 4, 4, 2) + 0.1, xpd=NA)

<Do your plotting>
# Then restore par() settings
par(opar)

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list