Created
January 23, 2021 06:04
-
-
Save Park-Developer/cccb4eb38532abbcb6d62799550c3bda to your computer and use it in GitHub Desktop.
matplotlib : rectangle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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