The Cape flora is remarkably species rich and ecologically diverse; as such, it constitutes an excellent flora in which to investigate the related phenomena of speciation and ecological diversification. This involves a combination of macroevolution (the relationships among species) and macroecology (the ecological comparisons of species). A list of putative ecological parameters is developed, for which species belonging to ecologically and phylogenetically divergent clades can be compared. The macroecological data is used to map the ecological Volumes Of four study clades, and their actual ecological space is compared by means of ordination. The temporal sequence of the occupation of the modern ecological space in Thamnochortus (Restionaceae) is investigated by optimising the ecological parameters to the internal nodes. Various optimisation methods are explored, and it is shown that the results are profoundly affected by the optimisation methods used. The increase in ecological diversity is shown to be paralleled by the increase in species diversity, but whether speciation precedes or follows ecological diversification is shown to be dependent on the optimisation method used. Ordination of the internal nodes shows a gradual occupation of the modern habitat, starting from an ancestral montane habitat, expanding to lowland, limestone hills, and eventually to mountain summits. There is a weak correlation between ecological and genetic distance among the species. A search for a general pattern in the speciation among the four genera investigated shows that most ecological parameters are involved in speciation among most of the lineages, but to different degrees. The broad exploitation of a rich diversity of different ecological parameters might have contributed to the remarkable species richness of the Cape flora.