how can i plot hysteresis in matplotlib?,fig = plt.figure()