Making sure to reset matplotlib state before each plot