summaryrefslogtreecommitdiffstats
path: root/data/combined
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2012-03-04 02:19:04 -0800
committerThibaut Horel <thibaut.horel@gmail.com>2012-03-04 02:19:04 -0800
commita0651121b5bf29743e19e69dd0421fedb0a8b2fd (patch)
treebddbaddd508f42efde635fc87460cf6639d2045f /data/combined
parent2fa61c47c9e93fdc4c4908dd9ee6e7885430e73b (diff)
downloadkinect-a0651121b5bf29743e19e69dd0421fedb0a8b2fd.tar.gz
Some cosmetics changes.
Fix the frame distribution plot, one point was missing also output plots directly in the right directory now
Diffstat (limited to 'data/combined')
-rwxr-xr-xdata/combined/graphs/plots.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/data/combined/graphs/plots.py b/data/combined/graphs/plots.py
index 7b3bb3e..fc13369 100755
--- a/data/combined/graphs/plots.py
+++ b/data/combined/graphs/plots.py
@@ -2,6 +2,10 @@
import numpy as np
import matplotlib.pyplot as plt
+import sys
+import os
+out_dir = sys.argv[1]
+
#frames distribution
plt.cla()
@@ -9,12 +13,14 @@ x = np.loadtxt("frames.txt",usecols=(0,))
y = range(1,len(x)+1)
width=0.8
plt.bar(y,x/x.sum()*100,width=width)
-plt.xlim(0.8,25)
+plt.xlim(0.8,26)
plt.xticks([i+width/2. for i in range(1,len(x),5)], range(1,len(x),5))
plt.xlabel("Individual")
plt.ylabel("Frame ratio [%]")
-plt.ylim(0,10)
-plt.savefig("frames.pdf")
+plt.ylim(0,17)
+ax = plt.gca()
+#ax.set_aspect(1)
+plt.savefig(os.path.join(out_dir,"frames.pdf"))
l = ["3","5","10","all"]
@@ -29,7 +35,7 @@ for i in l:
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
-plt.savefig("offline-nb.pdf")
+plt.savefig(os.path.join(out_dir,"offline-nb.pdf"))
#10-fold, SHT
#ax = plt.subplot(122)
#plt.axis([0,100,50,100])
@@ -43,7 +49,7 @@ for i in l:
plt.legend(loc="best")
plt.axis([0,100,50,100])
-plt.savefig("offline-sht.pdf")
+plt.savefig(os.path.join(out_dir,"offline-sht.pdf"))
#online,NB
plt.cla()
@@ -53,7 +59,7 @@ for i in l:
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
-plt.savefig("online-nb.pdf")
+plt.savefig(os.path.join(out_dir,"online-nb.pdf"))
#online,SHT
plt.cla()
for i in l:
@@ -62,7 +68,7 @@ for i in l:
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
-plt.savefig("online-sht.pdf")
+plt.savefig(os.path.join(out_dir,"online-sht.pdf"))
#face
@@ -74,7 +80,7 @@ plt.plot(100*a,100*b,linewidth=0.8,label="Face")
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
-plt.savefig("face.pdf")
+plt.savefig(os.path.join(out_dir,"face.pdf"))
#back
plt.cla()
@@ -87,7 +93,7 @@ plt.plot(100*c,100*d,linewidth=0.8,label="Train toward test away")
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
-plt.savefig("back.pdf")
+plt.savefig(os.path.join(out_dir,"back.pdf"))
#variance-reduction
plt.cla()
@@ -98,4 +104,4 @@ plt.plot(100*a,100*b,linewidth=0.8,label="Original noise")
plt.xlabel("Recall [%]")
plt.ylabel("Precision [%]")
plt.legend(loc="best")
-plt.savefig("var.pdf")
+plt.savefig(os.path.join(out_dir,"var.pdf"))