annotation_custom не размещает гробов - PullRequest
0 голосов
/ 06 декабря 2018

Вот код, который я написал:

sp9 <- ggplot(PWPdf3_12_1250, aes(log10(Avsize), log10(Prob))) +
  geom_point(color= "blue")

plotx <- ggplot(mpg, aes(displ, hwy)) + 
  geom_point() +
  geom_point(color= "blue")

#plot example from internet
plotx + 
  annotation_custom(
    ggplotGrob(sp9), 
    xmin = 5, xmax = 7, ymin = 30, ymax = 44
  )

#plotting my own data
sp9+ 
  annotation_custom(
    ggplotGrob(sp9), 
    xmin = 5, xmax = 7, ymin = 30, ymax = 44
  )

Выходные данные:

enter image description here

enter image description here

Я делаюне знаю, почему annotation_custom успешно вставляет гроб в случае 1, но не делает этого в случае 2. Я включил библиотеки egg и tidyverse

...