#幾何拼貼
import matplotlib.pyplot as plt
import numpy as np
plt.figure(figsize=(8,8),dpi=80)
plt.xlim(-100, 900)
plt.ylim(-100, 900)
for i in range(0,5):
for j in range(0,5):
X=[0,20,80,100]
Y=[0,60,40,100]
X = np.array(X)
Y = np.array(Y)
plt.plot(X+200*i,Y+200*j,color="blue",linewidth=1)
plt.plot(X+200*i,-1*Y+200*j,color="blue",linewidth=1)
plt.plot(-1*X+200*i,Y+200*j,color="blue",linewidth=1)
plt.plot(-1*X+200*i,-1*Y+200*j,color="blue",linewidth=1)
X=[0,65,35,100]
Y=[100,65,35,0]
X = np.array(X)
Y = np.array(Y)
plt.plot(X+200*i,Y+200*j,color="red",linewidth=1)
plt.plot(X+200*i,-1*Y+200*j,color="red",linewidth=1)
plt.plot(-1*X+200*i,Y+200*j,color="red",linewidth=1)
plt.plot(-1*X+200*i,-1*Y+200*j,color="red",linewidth=1)
plt.show()
Out[1]: