Habitat choice strategies and coexistence of specialists and generalists depend on the proportion and duration of marginal conditions (pm and tm, respectively) (SI Appendix, Fig. S2 has an illustration of the spatiotemporal variability implemented). The duration of marginal conditions tm is expressed relative to generation time (e.g., marginal conditions last for one generation when tm = 1). S and G refer to specialists and generalists, respectively. Scentral, Scold, and Swarm refer to specialist of the central patch, cold margin, and warm margin, respectively; + and − denote positive and negative habitat choice, respectively. The dark gray area illustrates the parameter space where a generalist with negative habitat choice (h = −1; G−) can coexist with a specialist with positive habitat choice (h = 1; Scentral+) (relative abundance and degree of specialization are in SI Appendix, Fig. S4). In the lower right region, only one strategy with positive habitat choice is favored, with specialization level that decreases when the proportion of marginal events increases (i.e., Scentral+ toward G+ when pm increase). This means that, although always showing a preference for the central temperature, there is a smooth transition in this region from a specialist toward a generalist. Increasing pm values above 0.7 expands the two regions on the right of the graph: either a single generalist (for low duration of marginal events tm) or specialists with positive habitat choice are favored (for higher tm).