...

/

Solution: Olympic Logo

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 commands
import matplotlib.pyplot as plt
import numpy as np
# Creating figure
f = plt.figure()
# Initialize time series
t = np.linspace(0, 2*np.pi, 1000)
# Create Yellow Circle
yellow_x = np.cos(t)
yellow_y = np.sin(t)
plt.plot(yellow_x,yellow_y,'-', color='#FDB813', linewidth=10)
# Create Green Circle
green_x = 2.5+np.cos(t)
green_y = np.sin(t)
plt.plot(green_x,green_y,'-', color='#00B248', linewidth=10)
# Create Blue Circle
blue_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 Circle
black_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 Circle
red_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 axis
plt.axis('equal')
plt.axis('off')
# Save Figure
plt.savefig('output/olympic.png')
# plt.show()

Explanation

We use Matplotlib to create a figure and plot five circles on it. The circles are created ...