The morphogenesis of sex combs (SCs), a male trait in many species of fruit flies, is an excellent system in which to study the cell biology, genetics and evolution of a trait. In Drosophila melanogaster, where the incipient SC rotates from horizontal to a vertical position, three signal comb properties have been documented: length, final angle and shape (linearity). During SC rotation, in which many cellular processes are occurring both spatially and temporally, it is difficult to distinguish which processes are crucial for which attributes of the comb. We have used a novel approach combining simulations and experiments to uncover the spatio-temporal dynamics underlying SC rotation. Our results indicate that 1) the final SC shape is primarily controlled by the inhomogeneity of initial cell size in cells close to the immature comb, 2) the final angle is primarily controlled by later cell expansion and 3) a temporal sequence of cell expansion mitigates the malformations generally associated with longer rotated SCs. Overall, our work has linked together the morphological diversity of SCs and the cellular dynamics behind such diversity, thus providing important insights on how evolution may affect SC development via the behaviours of surrounding epithelial cells.