Reputation: 935
My question is: imagine you have a list of length 484 and each element of the list is also a list of length of 484. Basically these lists in the list are going to be the rows in my matrix. I was wandering how can I plot this matrix and the color it based on the values of the matrix.
Thank you in advance.
Upvotes: 1
Views: 348
Reputation: 36
You can use:
plt.matshow(my_list)
This would work for your nested list but in general you can convert your nested list into a matrix by calling:
my_array = np.asarray(my_list)
Upvotes: 2