import numpy as np
import skfuzzy as fuzz
import matplotlib.pyplot as plt

#Defining the Fuzzy Range from a speed of 30 to 90
x = np.arange(30, 90, 0.1)#start&end of interval, step

#Defining the sigmoidal membership functions
full_speed = fuzz.sigmf(x, 80, 0.5)#center value of the sigmoid, magnitude
medium_fast = fuzz.sigmf(x, 60, 2)
medium = fuzz.sigmf(x, 50, 2)
slow = fuzz.sigmf(x, 30, 2)

plt.figure()
plt.plot(x, full_speed, 'b', linewidth=1.5, label='Full Speed')
plt.plot(x, medium_fast, 'k', linewidth=1.5, label='Medium Fast')
plt.plot(x, medium, 'm', linewidth=1.5, label='Medium Powered')
plt.plot(x, slow, 'r', linewidth=1.5, label='Slow')
plt.title('Penalty Kick Fuzzy')
plt.ylabel('Membership')
plt.xlabel("Speed (Miles Per Hour)")
plt.legend(loc='center right', bbox_to_anchor=(1.25, 0.5), ncol=1, fancybox=True, shadow=True)
plt.show()