Optimize figure size