Ultracold atoms in optical lattices realize simple condensed matter models. We create an ensemble of approximate to 60 harmonically trapped 2D Bose-Hubbard systems from a (87)Rb Bose-Einstein condensate in an optical lattice and use a magnetic resonance imaging approach to select a few 2D systems for study, thereby eliminating ensemble averaging. Our identification of the transition from superfluid to Mott insulator, as a function of both atom density and lattice depth, is in excellent agreement with a universal state diagram [M. Rigol et al., Phys. Rev. A 79 053605 (2009)] suitable for our trapped system. In agreement with theory, our data suggest a failure of the local density approximation in the transition region.