Improved plot resizing