Solution: Olympic Logo
Look into the solution of Olympic logo exercise.
We'll cover the following...
Solution
You can see the solution to drawing the Olympics logo below:
Press + to interact
# Import commandsimport matplotlib.pyplot as pltimport numpy as np# Creating figuref = plt.figure()# Initialize time seriest = np.linspace(0, 2*np.pi, 1000)# Create Yellow Circleyellow_x = np.cos(t)yellow_y = np.sin(t)plt.plot(yellow_x,yellow_y,'-', color='#FDB813', linewidth=10)# Create Green Circlegreen_x = 2.5+np.cos(t)green_y = np.sin(t)plt.plot(green_x,green_y,'-', color='#00B248', linewidth=10)# Create Blue Circleblue_x = -1.2+np.cos(t)blue_y = 0.9+np.sin(t)plt.plot(blue_x,blue_y,'-', color='#027A9F', linewidth=10)# Create Black Circleblack_x = 1.3+np.cos(t)black_y = 0.9+np.sin(t)plt.plot(black_x,black_y,'-', color='black', linewidth=10)# Create Red Circlered_x = 3.75+np.cos(t)red_y = 0.9+np.sin(t)plt.plot(red_x,red_y,'-', color='red', linewidth=10)# Set up axisplt.axis('equal')plt.axis('off')# Save Figureplt.savefig('output/olympic.png')# plt.show()
Explanation
We use Matplotlib to create a figure and plot five circles on it. The circles are created ...