import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from math import *
X = np.linspace(80, 140,400)
Y = np.zeros(400)
for i in range(0,400):
if 100 <= X[i] < 110:
Y[i]= X[i] - 100
if 110 <= X[i] < 120:
Y[i] = 120 - X[i]
p1 = plt.figure(1)
plt.plot(X,Y)
plt.title('Butterfly spread')
plt.ylabel('Vt')
plt.xlabel('St')
p1.show()
import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(80, 140,400)
Y = np.zeros(400)
for i in range(0,400):
if X[i] <= 100:
Y[i]= 100 - X[i]
if X[i] >= 120:
Y[i] = X[i] - 120
p1 = plt.figure(1)
plt.plot(X,Y)
plt.title('Strangle')
plt.ylabel('Vt')
plt.xlabel('St')
p1.show()