import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-1,1,10000)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_aspect('equal')
P = 5
for p in np.arange(0.3,P,0.2):
y = np.power(1-np.power(np.abs(x),p),1/p)
# 注意plot 是连点绘图方法,所以注意避免额外的连线产生
ax.plot(np.hstack([x,x[::-1]]),np.hstack([y,-y[::-1]]))
plt.title('p = '+str(p))
plt.pause(0.8)