Pattern formation of biological structures involves organizing different types of cells into a spatial configuration. In this study, we investigate the physical basis of biological patterning of the Drosophila retina in vivo. We demonstrate that E- and N-cadherins mediate apical adhesion between retina epithelial cells. Differential expression of N-cadherin within a sub-group of retinal cells (cone cells) causes them to form an overall shape that minimizes their surface contact with surrounding cells. The cells within this group, in both normal and experimentally manipulated conditions, pack together in the same way as soap bubbles do. The shaping of the cone cell group and packing of its components precisely imitate the physical tendency for surfaces to be minimized. Thus, simple patterned expression of N-cadherin results in a complex spatial pattern of cells owing to cellular surface mechanics.