I have 10 network realisations of the number of occurences for certain substructures in a web decomposition algorithm. I am considering the 10 most important webs and so I have ten entries in each list where each list is a realisation of the network. Basically I have a list of lists:
full_l2 = [[1, 1, 1, 1, 1, 1, 1, 1, 3, 1],
[1, 1, 1, 1, 1, 2, 2, 2, 1, 1],
[1, 1, 1, 1, 1, 2, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 3, 1, 1, 2, 2],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 3, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 2, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 2, 1]]
The numbers in the list tells the number of substructures and each list has the webs in decreasing order of importance. So I used:
occ = []
for i in range(10):
a = list(zip(*full_l2))[i]
occ.append(a)
to get the 1st, 2nd and so on upto 10th important webs. Now the occurences will look like:
occ = [(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(1, 1, 1, 1, 1, 1, 1, 3, 1, 1),
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(1, 2, 2, 1, 3, 1, 1, 1, 1, 1),
(1, 2, 1, 1, 1, 1, 1, 1, 2, 1),
(1, 2, 1, 1, 1, 1, 1, 1, 1, 1),
(3, 1, 1, 1, 2, 1, 1, 1, 1, 2),
(1, 1, 1, 1, 2, 1, 1, 1, 1, 1)]
So, I plot the histogram for the number of occurences. I am showing just 10 realisations so that the lists are easier to understand but I want to do it for 1000. I just used:
plt.hist(occ)
plt.yscale(log)
and I get a plot like this:
But I need to have it as a colormap. I tried using:
cm = plt.cm.get_cmap('jet')
and like this answer here: Plot histogram with colors taken from colormap
but it has a problem:
ValueError: color kwarg must have one color per dataset
I need it to look like:
Does anyone know if I am missing something?