Resource availability is an important constraint on community structure. Some authors have suggested it conceptually links two of the most basic patterns in ecology, the species–area relationship and the latitudinal gradient in species richness. I present the first experimental test of this conjecture, by manipulating both the area and resource concentration of artificial larval drosophilid fly habitats and then allowing colonization from a natural species pool. Both the abundance and species richness of these habitats depended upon the total quantity of resources available, regardless of whether those resources were contained within smaller high-quality habitats or larger poor-quality habitats. While the intercepts of species–area relationships varied with resource concentration, they all collapsed onto the same species–energy curve. These results support the view that energetic constraints are of fundamental importance in structuring ecological communities, and that such constraints may even help explain ecological patterns such as the species–area relationship that do not explicitly address resource availability.