0

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:

Remove plot axis values

ah bon
  • 9,293
  • 12
  • 65
  • 148

1 Answers1

2

Is this what you are looking for?

plot(img, axes=FALSE) 

enter image description here

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

Adam Quek
  • 6,973
  • 1
  • 17
  • 23