Skip to content

Instantly share code, notes, and snippets.

@Park-Developer
Created January 23, 2021 06:04
Show Gist options
  • Save Park-Developer/cccb4eb38532abbcb6d62799550c3bda to your computer and use it in GitHub Desktop.
Save Park-Developer/cccb4eb38532abbcb6d62799550c3bda to your computer and use it in GitHub Desktop.
matplotlib : rectangle
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
#define Matplotlib figure and axis
fig, ax = plt.subplots()
#create simple line plot
ax.plot([0, 10],[0, 10])
#add rectangle to plot
ax.add_patch(Rectangle((1, 1), 2, 6))
#display plot
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment