Pythonのmatplotlibで台形を描く方法
4つの辺をそれぞれ直線のグラフで描く
import matplotlib.pyplot as plt x = [0,1] y = [0,2] plt.plot(x, y, color='black') x = [0,2] y = [0,0] plt.plot(x, y, color='black') x = [1,2] y = [2,2] plt.plot(x, y, color='black') x = [2,2] y = [0,2] plt.plot(x, y, color='black') plt.axis('equal') plt.axis('off') plt.show()