Check if one plot only contains a low-level update of another plot.
is_low_change(p1, p2)
Logical value indicating whether p2
is a low-level update of
p1
.
pdf(NULL)
dev.control("enable") # enable plot recording
plot(1:10)
p1 = recordPlot()
abline(0, 1) # add a line (a low-level change)
p2 = recordPlot()
plot(rnorm(100))
p3 = recordPlot() # draw a completely new plot
dev.off()
#> pdf
#> 2
knitr::is_low_change(p1, p2) # true
#> [1] TRUE
knitr::is_low_change(p1, p3) # false
#> [1] FALSE