Home > Software engineering >  Hide x and y axis from the plot loaded with imager package
Hide x and y axis from the plot loaded with imager package

Time:05-24

I try to code below to insert and display an image in the presentation file with rmarkdown:

library(imager)
img <- load.image('https://makeshop-multi-images.akamaized.net/figmaster1/shopimages/98/82/1_000000018298.jpg')
plot(img, xaxt = "n", yaxt = "n")

Out:

enter image description here

My question is how could I remove x and y axis from the figure? which means I hope to remove the contents in the grey rectangles.

I've added xaxt = "n", yaxt = "n" inside plot(), it seems not working out.

References:

enter image description here

Check the documentation at https://www.rdocumentation.org/packages/imager/versions/0.42.13/topics/plot.cimg

  • Related