Showing
1 changed file
with
7 additions
and
2 deletions
... | @@ -2060,7 +2060,7 @@ def GMM_histo(data_ori, name_data, toric=False, hist=True, couleur=None, save=Tr | ... | @@ -2060,7 +2060,7 @@ def GMM_histo(data_ori, name_data, toric=False, hist=True, couleur=None, save=Tr |
2060 | plt.plot(newx, newy, c=colors[i]) | 2060 | plt.plot(newx, newy, c=colors[i]) |
2061 | else: | 2061 | else: |
2062 | # store for later summation | 2062 | # store for later summation |
2063 | - courbes.append(newy) | 2063 | + courbes.append(np.array(newy)) |
2064 | 2064 | ||
2065 | if hist: | 2065 | if hist: |
2066 | plt.title("Histogramme " +name_data+ " avec GMM pour " +str(nb_components)+ " composantes (" + str(len(data_ori))+" valeurs)") | 2066 | plt.title("Histogramme " +name_data+ " avec GMM pour " +str(nb_components)+ " composantes (" + str(len(data_ori))+" valeurs)") |
... | @@ -2069,7 +2069,12 @@ def GMM_histo(data_ori, name_data, toric=False, hist=True, couleur=None, save=Tr | ... | @@ -2069,7 +2069,12 @@ def GMM_histo(data_ori, name_data, toric=False, hist=True, couleur=None, save=Tr |
2069 | plt.close() | 2069 | plt.close() |
2070 | else: | 2070 | else: |
2071 | # Plot their sum, do not save figure yet | 2071 | # Plot their sum, do not save figure yet |
2072 | - plt.plot(newx, sum(courbes), c=couleur, label=name_data) | 2072 | + try: |
2073 | + plt.plot(newx, sum(courbes), c=couleur, label=name_data) | ||
2074 | + except TypeError: | ||
2075 | + print("N curves:", len(courbes)) | ||
2076 | + for c in courbes: | ||
2077 | + print(c) | ||
2073 | plt.legend() | 2078 | plt.legend() |
2074 | 2079 | ||
2075 | # Save the json | 2080 | # Save the json | ... | ... |
-
Please register or login to post a comment