Final 4 quadrant code with plot