我在x軸上有一個帶有對數刻度的圖形。嘗試創建一個插入圖不起作用,但如果比例更改爲線性,則顯得很好。有沒有辦法解決這個問題,還是ggplot的限制?如何讓ggplot2顯示一個插圖,當主人有一個日誌規模?
這工作:
p = qplot(1:10, 1:10)
g = ggplotGrob(qplot(1, 1))
p + annotation_custom(grob = g, xmin = 3, xmax = 6, ymin = 6, ymax = 10)
這不:
p = qplot(1:10, 1:10, log='x')
g = ggplotGrob(qplot(1, 1))
p + annotation_custom(grob = g, xmin = 3, xmax = 6, ymin = 6, ymax = 10)
對於通用的解決方案:http://stackoverflow.com/a/37857548/956338(但這個答案真的幫助我開始) – pallevillesen