[R] colours change in barplot

Tord Snall tord.snall at ebc.uu.se
Wed Feb 26 21:07:07 CET 2003


Dear all,

I use the code below for my barplot and it looks fine on my screen. But
when I paste into my MSWord file, after having copied it by presing the
camera, the colours change. The same actually happens when I change the
size of the R Graphics Device window by dragging the corners.

Could someone please help with this.

I use R 1.6.2 on Win XP.

Thanks in advance!


Sincerely,
Tord Snäll

par(mar=c(5, 12, 1, 2), mai=c(1, 2.2, 0.01, 0.2), xpd=NA) # yttre kanterna
och plotting även i Margin V&R, sid 66
(palette(gray(seq(0,.9,len=25)))) # gray scales; print old palette
barplot(as.matrix(t(nedbr[nedbr$fran.lan == "X", c("nedbr1volS.ha",
"nedbr2volS.ha", "nedbr3volS.ha", "nedbr4volS.ha", "nedbr5volS.ha")])), 
        names.arg = as.vector(nedbr[nedbr$fran.lan == "X", "Objektnamn"]),  
        horiz=T, las=1, cex.names=0.8, xlab="Volym m3/ha", xlim=c(0,100),
col=c(25,21,17,14,10))

legend(locator(1), c("Nedbrytning 1 (<10%)", "Nedbrytning 2 (10-25%)",
"Nedbrytning 3 (25-50%)", 
        "Nedbrytning 4 (50-75%)", "Nedbrytning 5 (75-100%)"),
fill=c(25,21,17,14,10), cex=0.75)
palette("default")      # reset back to the default


-----------------------------------------------------------------------
Tord Snäll
Avd. f växtekologi, Evolutionsbiologiskt centrum, Uppsala universitet
Dept. of Plant Ecology, Evolutionary Biology Centre, Uppsala University
Villavägen 14			
SE-752 36 Uppsala, Sweden
Tel: 018-471 28 82 (int +46 18 471 28 82) (work)
Tel: 018-25 71 33 (int +46 18 25 71 33) (home)
Fax: 018-55 34 19 (int +46 18 55 34 19) (work)
E-mail: Tord.Snall at ebc.uu.se
Check this: http://www.vaxtbio.uu.se/resfold/snall.htm!
------------------------------------------------------------------------




More information about the R-help mailing list