2
R이 처음인데 R을 사용하여 동일한 페이지에 그래프와 이미지를 표시하려고 시도했습니다. library(ggpubr)
및 ggarrange()
함수를 사용해 보았습니다.R과 동일한 패널에 표시 할 그래프와 이미지를 만드는 방법
이미지를 가져 오려면 library(png)
및 readPNG()
을 사용하여 이미지를 가져 오십시오.
내가 패널을 만드는 데 사용되는 코드는 다음과 같습니다 :
저주의library(ggpubr)
library(png)
data("ToothGrowth")
bxp <- ggboxplot(ToothGrowth, x = "dose", y = "len",
color = "dose", palette = "jco")
dp <- ggdotplot(ToothGrowth, x = "dose", y = "len",
color = "dose", palette = "jco", binwidth = 1)
img1 <- readPNG("image1.png")
img2 <- readPNG("image2.png")
im_A <- ggplot() + background_image(img1) # tried to insert the image as background.. there must be a better way
im_B <- ggplot() + background_image(img2)
ggarrange(im_A, im_B, dp, bxp,
labels = c("A", "B", "C", "D"),
ncol = 2, nrow = 2)
내가 수동으로 이미지를 삽입
내가 목표로하고있어 최종 결과는이 같은 것입니다 파워 포인트를 사용합니다.
감사합니다.
멋진 작품입니다. 고맙습니다 –