RosettaCodeData/Task/Draw-a-pixel/R/draw-a-pixel.r
2026-04-30 12:34:36 -04:00

9 lines
263 B
R

disp_h <- 240
disp_w <- 320
mat <- matrix(0, nrow = disp_w, ncol = disp_h)
mat[100, 100] <- 1
png("DrawPixel-R.png", disp_w, disp_h)
op <- par(mar = rep(0, 4), mai = rep(0, 4))
image(mat, col = c("white", "red"), useRaster = TRUE, axes = FALSE)
par(op)
dev.off()