Untitled
unknown
plain_text
a year ago
1.2 kB
5
Indexable
import matplotlib.pyplot as plt import matplotlib.patches as patches # Create a figure and axis fig, ax = plt.subplots() # Set the background color of the flag ax.set_facecolor('green') # Add the gold cross ax.add_patch(patches.Rectangle((0.4, 0), 0.2, 1, facecolor='gold', edgecolor='none')) ax.add_patch(patches.Rectangle((0, 0.4), 1, 0.2, facecolor='gold', edgecolor='none')) # Add the bottom half of the flag with gold background ax.add_patch(patches.Rectangle((0, 0), 1, 0.5, facecolor='gold', edgecolor='none')) # Add a green book at the center of the gold area book = patches.Rectangle((0.4, 0.2), 0.2, 0.3, facecolor='green', edgecolor='none') ax.add_patch(book) # Add a laurel wreath around the book (simplified as a circle here) laurel_wreath = patches.Circle((0.5, 0.35), 0.15, facecolor='none', edgecolor='green', linewidth=2) ax.add_patch(laurel_wreath) # Add a small maple leaf in the center of the cross (simplified as a star here) maple_leaf = patches.RegularPolygon((0.5, 0.5), numVertices=5, radius=0.05, facecolor='red', edgecolor='none') ax.add_patch(maple_leaf) # Remove axes ax.set_xticks([]) ax.set_yticks([]) ax.axis('off') # Display the flag plt.show()
Editor is loading...
Leave a Comment