Better handling of plot window