figure 7 Python plot code