Horje
add rectangle matplotlib Code Example
add rectangle matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from PIL import Image

im = Image.open('stinkbug.png')

# Create figure and axes
fig, ax = plt.subplots()

# Display the image
ax.imshow(im)

# Create a Rectangle patch
rect = patches.Rectangle((50, 100), 40, 30, linewidth=1, edgecolor='r', facecolor='none')

# Add the patch to the Axes
ax.add_patch(rect)

plt.show()
add rectangle matplotlib

import matplotlib.pyplot as plt
import matplotlib.patches as patches
from PIL import Image

im = Image.open('stinkbug.png')

# Create figure and axes
fig, ax = plt.subplots()

# Display the image
ax.imshow(im)

# Create a Rectangle patch
rect = patches.Rectangle((50, 100), 40, 30, linewidth=1, edgecolor='r', facecolor='none')

# Add the patch to the Axes
ax.add_patch(rect)

plt.show()





Python

Related
column.replace Code Example column.replace Code Example
Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming Code Example Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming Code Example
make python use python3 Code Example make python use python3 Code Example
pandas Unnamed: 0 Code Example pandas Unnamed: 0 Code Example
how to translate to string to different alphabet python Code Example how to translate to string to different alphabet python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7