Average plot is now correctly removed when checkbox is checked.
Removed redundant Re-plot button. Action replaced by the checkbox.

With code cleanup.