import matplotlib.pyplot as plt
import numpy as np
from math import exp

l = 20
M = np.zeros((l, 2*l - 1), dtype=int)
mi = int(M.shape[1] / 2)# mid index

k = 1
for i in range(M.shape[0]):
    for j in range(mi - i, mi + i + 1):
        M[i][j] = k
        k += 1

M = np.transpose(M)

for row in M:
    plt.plot(row)

# print(M)

plt.grid()
plt.show()
791fb3d506cac61051abe2ccca78a59e5faf5405
<mask token>

<mask token>
for i in range(M.shape[0]):
    for j in range(mi - i, mi + i + 1):
        M[i][j] = k
        k += 1
<mask token>
for row in M:
    plt.plot(row)
plt.grid()
plt.show()

<mask token>
l = 20
M = np.zeros((l, 2 * l - 1), dtype=int)
mi = int(M.shape[1] / 2)
k = 1
for i in range(M.shape[0]):
    for j in range(mi - i, mi + i + 1):
        M[i][j] = k
        k += 1
M = np.transpose(M)
for row in M:
    plt.plot(row)
plt.grid()
plt.show()

import matplotlib.pyplot as plt
import numpy as np
from math import exp
l = 20
M = np.zeros((l, 2 * l - 1), dtype=int)
mi = int(M.shape[1] / 2)
k = 1
for i in range(M.shape[0]):
    for j in range(mi - i, mi + i + 1):
        M[i][j] = k
        k += 1
M = np.transpose(M)
for row in M:
    plt.plot(row)
plt.grid()
plt.show()

import matplotlib.pyplot as plt
import numpy as np
from math import exp

l = 20
M = np.zeros((l, 2*l - 1), dtype=int)
mi = int(M.shape[1] / 2)# mid index

k = 1
for i in range(M.shape[0]):
    for j in range(mi - i, mi + i + 1):
        M[i][j] = k
        k += 1

M = np.transpose(M)

for row in M:
    plt.plot(row)

# print(M)

plt.grid()
plt.show()