Matplotlib working code