[R] R: plotting values on graphics

joseph d. hughes jdhughes99 at mindspring.com
Fri Oct 6 14:51:47 CEST 2000


Everyone,

I have an array of integer values which are located on a uniform 2-D grid.  I want to plot the integer values at the node locations. The closest I have come is with the following code:

for (i in 1:ny) {
  for (j in 1:nx) {
  ncell <- nx*(i - 1) + j
  ch <- as.character(ncount[ncell])
  tx <- j*dx - dx/2
  ty <- ny*dy - (i-1)*dy - dy/2
  points(tx, ty, pch = ch, col = "red", bg = "yellow", cex = 3)
  }
}

The problem with the code above is I only get a one character symbol at each node (e.g. n=123 gives me 1 on the screen).  Is there something wrong with my as.character or points function calls?  Is there a better way to do this?

Thanks in advance,

Joseph Hughes
jdhughes99 at mindspring.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20001006/daeadf08/attachment.html


More information about the R-help mailing list