Browse Source

log scale

Lucas Gautheron 3 months ago
parent
commit
0d8407bc77
2 changed files with 23289 additions and 8094 deletions
  1. 8 6
      plot_votes_distrib.py
  2. 23281 8088
      votes_distrib.eps

+ 8 - 6
plot_votes_distrib.py

@@ -2,20 +2,22 @@ import numpy as np
 from scipy.stats import dirichlet
 import ternary
 
-scale = 1
+scale = 60
 
 x = np.load("votes_distrib.npz")
 alphas = x["alphas"].mean(axis=0)
 
 def prob(p):
-    try:
-        return dirichlet.pdf(p, alphas)
-    except:
-        return np.array([np.nan, np.nan, np.nan])
+    p = np.array(p)
+    print(p)
+    if np.all(p>0):
+        return dirichlet.logpdf(p, alphas)
+    else:
+        return 0
 
 figure, tax = ternary.figure(scale=scale)
 tax.heatmapf(prob, boundary=True, style="triangular")
 tax.boundary(linewidth=2.0)
 tax.set_title("Shannon Entropy Heatmap")
 
-tax.savefig("votes_distrib.eps")
+tax.savefig("votes_distrib.eps")

File diff suppressed because it is too large
+ 23281 - 8088
votes_distrib.eps