In [1]:
import math
import matplotlib.pyplot as plt
import seaborn as sns
In [2]:
sF = [r/1000 for r in range(10000,16001)]
m = [10-100/s for s in sF]
In [3]:
def marginVictory():
    sns.set()
    fig = plt.figure(figsize = (12, 8))
    ax = fig.add_subplot(111, xlim = (10,16), ylim = (m[0], m[-1]))

    #Asymptote
    #ax.axhline(y = 0.721348,
              # xmin = 0,
              # xmax = 1,
               #c = '#440154',
               #zorder = 1)

    ax.scatter(x = sF,
               y = m,
               c = "#1F968B",
               zorder = 2)
    
    ax.ticklabel_format(style = "plain",
                        useOffset = False)
    
    ax.axhline(y = 2.17, c = '#481567', ls = ":", lw = 5)
    
    ax.annotate(text = "Avg. Margin of Victory ≈ 2.17 sec",
                xy = (10, 2.3),
                c = '#481567',
                fontsize = 16)
 
    #Titles and Axis
    ax.set_title("Usain Bolt vs The Flash", fontsize = 24)
    ax.set_xlabel("The Flash's Speed (meters/second)", fontsize = 18)
    ax.set_ylabel("Margin of Victory (seconds)", fontsize = 18);
    
    fig.savefig("2022.04.22 Express.png")
In [4]:
marginVictory()