figure 4 Python plot code