one function call correction
protect autoplot() call by if (interactive())