[R] Odp: help with image function

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Wed Oct 24 13:44:17 CEST 2007


The Disney way:
 
par(mar=c(2,8,2,2))
barplot(rep(1,10), axes=FALSE, names=rev(paste(breaks[1:10], breaks[2:11], sep="-")), horiz=TRUE, col=heat.colors(10), las=2)


 

________________________________

From: r-help-bounces at r-project.org on behalf of Petr PIKAL
Sent: Wed 24/10/2007 11:33 AM
To: Jonas Öster
Cc: r-help at r-project.org
Subject: [R] Odp: help with image function



Hi

r-help-bounces at r-project.org napsal dne 24.10.2007 12:01:09:

> Hallo!
> Have succeded in creating an image plot using image()
> Have failed to provide explanation to what the colors means in terms of
> values/numbers (i.e. the height of the staples that the colors
represent).
> Wonder if anyone have any help to offer in this matter? Have tried with
> convertColor() and palette() without succes.
> I attach the code below and the output in an attached pdf

I am not completely sure but the colours shall represent values of "z"
which are between coresponding break values. So from yellow to red you the
values are increasing.

You can test it if you expand 1:13 and 0:24 and put "z" values into your
picture by

text(x, y, z)

Regards
Petr

>
> Thanks a lot /Jonas (University of Uppsala, Sweden)
>
>
> #//Plot18 3D-image containing above diurnal distr plots
> filename = sprintf("%s18%s3Dimage.pdf", output, sn)
> main = sprintf("Diurnal Distr of Whistlers Divided into Months \n %s
%s",
> station, period)
> sub = sprintf("LT=Local Time, GMT=Greenwich Mean Time \n No
consideration
> taken for days when receiver did not operate")
> breaks = c(1,5,10,50,100,500,1000,5000,10000,50000,100000)
> pdf(filename) #recording to .pdf
> image(z=z, x=1:13, y=0:24, col= heat.colors(10), breaks=breaks,
main=main,
> xlab="", ylab="", sub=sub, axes=FALSE)
> grid(nx=12, ny=24, col="black")
> axis(side=2, labels=lclockmarks, at=clockmarks, line=0)
> mtext(text="LT", side=2, line=1, at=-2)
> axis(side=2, labels=clockmarks, at=clockmarks, line=2, tick=FALSE)
> mtext(text="GMT", side=2, line=3, at=-2)
> axis(side=1, labels=labels, at=at, line=-1, tick=FALSE)
> dev.off()
> [príloha 18TH3Dimage.pdf odstranena uzivatelem Petr PIKAL/CTCAP]
> ______________________________________________
> 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.

______________________________________________
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.



More information about the R-help mailing list