01
import numpy as np
import matplotlib.pyplot as plt
# 该行用于设置chart 的样式,可以注掉
plt.style.use("mystyle")
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.spines['left'].set_color('none')
ax.spines['bottom'].set_color('none')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.set_xticks([])
ax.set_yticks([])
# 实现功能
theta = np.arange(0, 2 * np.pi + 0.1,2 * np.pi / 1000)
x = np.cos(theta)
y = np.sin(theta)
v = np.linspace(0, 10, 100)
v.shape = (100, 1)
x = v * x
y = v * y
plt.plot(x, y, color='red')
plt.show()
02
import numpy as np
import matplotlib.pyplot as plt
# 该行用于设置chart 的样式,可以注掉
plt.style.use("mystyle")
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.spines['left'].set_color('none')
ax.spines['bottom'].set_color('none')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.set_xticks([])
ax.set_yticks([])
# 实现功能
theta = np.arange(0, 2 * np.pi, 2 * np.pi / 100)
theta = np.append(theta, [2 * np.pi])
x = np.cos(theta)
y = np.sin(theta)
v = np.linspace(0, 10, 100)
for r in v:
x1 = r * x
y1 = r * y
plt.plot(x1, y1)
plt.show()
03
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors
# 该行用于设置chart 的样式,可以注掉
plt.style.use("mystyle")
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(111)
ax.spines['left'].set_color('none')
ax.spines['bottom'].set_color('none')
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.set_xticks([])
ax.set_yticks([])
theta = np.arange(0, 2 * np.pi, 2 * np.pi / 1000)
theta = np.append(theta, [2 * np.pi])
v = np.linspace(0, 10, 10)
mx = np.max(theta)
for tha in theta:
x1 = v * np.cos(tha)
y1 = v * np.sin(tha)
c = tha / mx
plt.plot(x1, y1,color=(x1[0], c, y1[0]))
plt.show()
End