Microbubble or pendant drop control described by a general phase diagram