r - Add text and line to an `image()` in graphics -
i generated image in r two-dimensional data - x.
graphics::image(ifelse(drop(x)!=0, x, na)) i add text , line image.
i attempted text(10, 10, "testing") , segments(5, 10, 20, 25), neither text nor line displayed.
as @mrflick mentioned, image() rescales values 0-1 range.
see below example:
#dummy data set.seed(123) x <- matrix(runif(100),nrow=10) #plot image(x) #add text , line text(0.1,0.1,"text") segments(0.5,0.1,0.2,0.25) 
Comments
Post a Comment