nearsq function

Find optimum plotting grid