How social aggregations arise and persist is central to our understanding of evolution, behavior, and psychology. When social groups arise within a species, evolutionary divergence and speciation can result. To understand this diversifying role of social behavior, we must examine the internal and external influences that lead to nonrandom assortment of phenotypes. Many fishes form aggregations called shoals that reduce predation risk while enhancing foraging and reproductive success. Thus, shoaling is adaptive, and signals that maintain shoals are likely to evolve under selection. Given the diversity of pigment patterns among Danio fishes, visual signals might be especially important in mediating social behaviors in this group. Our understanding of pigment pattern development in the zebrafish D. rerio allows integrative analyses of how molecular variation leads to morphological variation among individuals and how morphological variation influences social interactions. Here, we use the zebrafish pigment mutant nacre/mitfa to test roles for genetic and environmental determinants in the development of shoaling preference. We demonstrate that individuals discriminate between shoals having different pigment pattern phenotypes and that early experience determines shoaling preference. These results suggest a role for social learning in pigment pattern diversification in danios.