implementing residual resampling
warn if tikzDevice not available