我想创建一个自动调整功能,在x轴上引入一个中断。
这是我的数据集,已经进行了日志转换:
structure(list(log10 = c(1.62457434052758, 1.53152877697842,
1.69833932853717, 1.59102517985612, 1.94931654676259, 1.84150479616307,
1.50785971223022, 1.51459832134293, 1.50166067146283, 1.51618105515588,
1.511396882494), log2 = c(25.4397183098679, 25.4060364200204,
25.0540964465711, 24.9491581403185, 24.4560020696222, 23.6694432390975,
10.5872019469992, 8.36608412759539, 7.9999573891952, 7.16653210552076,
6.72718914855774)), .Names = c("log10", "log2"), row.names = c(578L,
572L, 582L, 537L, 562L, 579L, 20L, 29L, 71L, 92L, 19L), class = "data.frame")
以下是绘制时的外观:
plot(log10 ~ log2, df)
此处已解释了概念上类似的解决方案:https://joergsteinkamp.wordpress.com/2016/01/22/broken-axis-with-ggplot2/
但我希望自动调整到给定的数据集。这样,隐藏数据点的问题就越少,这使得该方法不那么值得怀疑。