In [24]:
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()
/usr/lib/python3.6/site-packages/ipykernel_launcher.py:18: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
In [25]:
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()
/usr/lib/python3.6/site-packages/ipykernel_launcher.py:15: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  from ipykernel import kernelapp as app