knitr::opts_chunk$set(echo = TRUE)
Open the decoration in QGIS. The width of the image is equivalent to the x-axis, the height of the image is equivalent to the y-axis
The QGIS coordinates are:
top-left: origins (0,0)
top-right: (666,0)
bottom-right: (666,750)
bottom-left: (0,750)
{width=66%}
Read the decoration image with the R magick package and show image proprieties
library(knitr) library(kableExtra) library(magick) path_img <- "D:/Sites_10/Abela/Abela.jpg" img <- image_read(path_img) image_info(img)
Plot the image
plot(image_trim(img))
Add the coordinates of the image four corners:
top-left
top-right
bottom-right
bottom-left
# par(mar = c(0,0,0,0)) plot(img) box(lwd = 2) # min width & min height (origin) text(0, 0, paste0(0, ",", 0), cex = 1, adj = c(0, -0.2)) # min width & max height text(0, image_info(img)$height, paste0(0, ",", image_info(img)$height), cex = 1, adj = c(0, 1.1)) # max width & min height text(image_info(img)$width, 0, paste0(image_info(img)$width, ",", 0), cex = 1, adj = c(1, -0.2)) # max width & max height text(image_info(img)$width, image_info(img)$height, paste0(image_info(img)$width, ",", image_info(img)$height), cex = 1, adj = c(1, 1.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.