<｜begin▁of▁sentence｜>### Instruction:
Given the width and height of a rectangle (4 and 2 respectively), and the assumption that the upper left corner is at the origin (0,0), how would you use matplotlib to draw this rectangle on a plot?
### Response:
import matplotlib.pyplot as plt
import matplotlib.patches as patches

# Creating a rectangle with width 4 and height 2
# Assuming the upper left corner is at (0, 0)
rect = patches.Rectangle((0, 0), 4, 2, linewidth=1, edgecolor='r', facecolor='none')

# Adding the rectangle to the current axes
ax = plt.gca()
ax.add_patch(rect)
plt.xlim(-1, 5)
plt.ylim(-1, 3)
plt.show()
<|EOT|>
