Design of novel artificial materials based on ferroelectric perovskites relies on the basic principles of electrostatic coupling and in-plane lattice matching. These rules state that the out-of-plane component of the electric displacement field and the in-plane components of the strain are preserved across a layered superlattice, provided that certain growth conditions are respected. Intense research is currently directed at optimizing materials functionalities based on these guidelines, often with remarkable success. Such principles, however, are of limited practical use unless one disposes of reliable data on how a given material behaves under arbitrary electrical and mechanical boundary conditions. Here we demonstrate, by focusing on the prototypical ferroelectrics PbTiO3 and BiFeO3 as testcases, how such information can be calculated from first principles in a systematic and efficient way. In particular, we construct a series of two-dimensional maps that describe the behavior of either compound (e.g. concerning the ferroelectric polarization and antiferrodistortive instabilities) at any conceivable choice of the in-plane lattice parameter, a, and out-of-plane electric displacement, D. In addition to being of immediate practical applicability to superlattice design, our results bring new insight into the complex interplay of competing degrees of freedom in perovskite materials, and reveal some notable instances where the behavior of these materials depart from what naively is expected.