import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
import numpy as np
fig, ax = plt.subplots(figsize=(8, 5))
ax.fill_between([0, 3], 2, 3, color="#FED100")
ax.fill_between([0, 3], 1, 2, color="#34B233")
ax.fill_between([0, 3], 0, 1, color="#EA2839")
def draw_star(center_x, center_y, radius, color, rotation_deg):
points = []
for i in range(10):
angle = (i * 36 + rotation_deg) * (np.pi / 180)
r = radius if i % 2 == 0 else radius / 2
x = center_x + r * np.cos(angle)
y = center_y + r * np.sin(angle)
points.append((x, y))
polygon = Polygon(points, closed=True, color=color)
ax.add_patch(polygon)
draw_star(1.5, 1.5, 0.6, "white", rotation_deg=-55)
ax.set_xlim(0, 3)
ax.set_ylim(0, 3)
ax.axis("off")
plt.show()
print("Happy Independence Day Myanmar ")
#source code --> clcoding.com
0 Comments:
Post a Comment