[R] How to draw a graphic using data with coordinates and production rate?

Daniel Malter daniel at umd.edu
Fri May 14 21:46:36 CEST 2010


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.



More information about the R-help mailing list