Sex changes in plants
Diphasic sex expression (also known as labile sex expression or sex change), is defined as the alteration of the primary sex during the lifetime of an individual found within dioecious and subdioecious species. This change in sex expression is a response to environmental cues such as sun exposure and rainfall or drought levels. Labile sex expression is a type of diphasic sex expression that is found among many perennial plant species, and is defined as the switch from male to female once the plant has reached a certain size. In species with labile sex expression this change occurs only once, where as a plant expressing diphasic sex tendencies can switch from season to season.
Diphasic sex expression in plants.
One well studied plant species with diphasic sex expression is "Arisaema Triphyllum," commonly known as Jack-in-the-pulpit. It is hypothesized that diphasic plant species have higher fitness when expressing only one sex at a time when there are trade-offs between size and reproductive success through male and female function. Due to conflict between male and female function when pollen and ovules are produced in the same flower, one sex is ultimately favored over the other dependent on plant size. This sex trade-off is responsible for determining the population sex ratio, meaning the relative amount of male versus female individuals. If there are more males (typically smaller in size) than females (larger) for one season, then the males will have a lower reproductive contribution than females. However, considering their diphasic tendencies, male and female contribution should eventually reach equilibrium over time.
Diphasic sex expression in animals.
Diphasic sex expression is not limited just to plants, as many species of fish also alter their sex. About two percent of known fish species display sequential hermaphroditic changes. For example, juvenile Caribbean parrot fish are female when young and may transition to male as they age. Many of these terminal phase males then go on to fulfill varying roles such as female and territorial protection. 
References.
 ;templatestyles src="Reflist/styles.css" / ;