import numpy as np
import matplotlib.pyplot as plt
data = [1,1,1,1,1,1,1,1,1,1]
arr = np.zeros((4,4))
indices = np.tril_indices(4)
arr[indices] = data
print(arr)
# array([[ 1., 0., 0., 0.],
# [ 1., 1., 0., 0.],
# [ 1., 1., 1., 0.],
# [ 1., 1., 1., 1.]])
plt.imshow(arr, interpolation='nearest', cmap=plt.get_cmap('RdYlGn'))
plt.show()
plots