implement grid graph which allows one to draw multiple graphs on the same canvas