Daniel Malter
2010-May-14 03:59 UTC
[R] How to draw a graphic using data with coordinates and production rate?
Hi, assuming your production figures are in a square matrix, where points with no production take zero and points with production take the production figure, you could use image() This is the most basic approach I would think. Daniel -- View this message in context: http://r.789695.n4.nabble.com/How-to-draw-a-graphic-using-data-with-coordinates-and-production-rate-tp2197568p2216078.html Sent from the R help mailing list archive at Nabble.com.
Daniel Malter
2010-May-14 19:46 UTC
[R] How to draw a graphic using data with coordinates and production rate?
Oh, if plot does the thing, then you just want to specify the color argument accordingly, where the color argument is given by your production figure. x=seq(1:100) y=seq(1:100) x.coord=sample(x,100) y.coord=sample(y,100) production=sample(1:100, 100) plot(y.coord~x.coord) #now lets say we want full instead of empty points plot(y.coord~x.coord, pch=16) #now lets say we want the points blue plot(y.coord~x.coord, pch=16, col="blue") #now lets say we want them in the same blue but with saturation varying by the production number plot(y.coord~x.coord, pch=16, col=rgb(0,0,100,production,maxColorValue=100)) #note that you may want to have maxColorValue=max(production) (or scale the production value accordingly) #and that you may want to have the color value (here for blue) also at that same value #now lets do red instead plot(y.coord~x.coord, pch=16, col=rgb(100,0,0,production,maxColorValue=100)) HTH, Daniel -- View this message in context: http://r.789695.n4.nabble.com/How-to-draw-a-graphic-using-data-with-coordinates-and-production-rate-tp2197568p2217136.html Sent from the R help mailing list archive at Nabble.com.