Explain the change in demand of a good on account of change in prices of related goods

Explain the change in demand of a good on account of change in prices of related goods.
or
How is demand for a commodity affected by the rise in price of related goods? Explain with the help of diagram. or
Explain how the demand for a good is affected by the price of its related goods. Give examples.

Related goods are of two types:
(i) Substitute goods When price of the substitute good increases, demand curve for good X shifts to the right, implying demand increases from OQ to O${ Q}{ 1 } even when price of good X continues to be OP and vice-versa, e.g. an increase in the price of coffee will result in an increase in demand of its substitute good, i.e. tea. (ii) Complementary goods When price of the complementary good increases, demand curve for good X shifts to the left, implying demand decreases from OQ to O{ Q}{ 2 }$ even when price of good A continues to be OP and vice-versa, e.g. an increase in price of petrol will result in decrease in demand of its complementary good, i.e. car. Following figure illustrates the effect of change in price of the related goods: