R/show_image.R

Defines functions show_image

show_image = function( fn ){
  par(mar=c(0.5, 0.5, 0.5, 0.5))
  o = png::readPNG(fn)
  res = dim(o)[2:1] # get the resolution, [x, y]
  plot(1,1,xlim=c(1,res[1]),ylim=c(1,res[2]),asp=1,type='n',
    xaxs='i',yaxs='i',xaxt='n',yaxt='n',xlab='',ylab='',bty='n')
  rasterImage(o, 1,1,res[1],res[2])
} 
jae0/aegis documentation built on Jan. 14, 2025, 7:46 p.m.