In [1]:
import numpy as np
import matplotlib.pyplot as plt
In [2]:
length = 3
width = 4
# left_bottom = np.array([2, -9])
In [3]:
center = np.array([4, 5])
left_bottom = center - np.array([length/2, width/2])
In [4]:
A = left_bottom
B = left_bottom + np.array([length, 0])
C = left_bottom + np.array([length, width])
D = left_bottom + np.array([0, width])
In [5]:
plt.plot(*center, color = 'red', marker = 'o')
plt.plot([A[0], B[0], C[0], D[0], A[0]],
[A[1], B[1], C[1], D[1], A[1]])
# plt.axis('off')
plt.xlim(-10, 10)
plt.ylim(-10, 10)
Out[5]:
In [ ]: