Implementation for plots 1 and 2
Implementation of plots 3 and 4