Mercurial > hg > aimc
comparison trunk/experiments/scripts/cnbh-syllables/results_plotting/plot_all_results.m @ 381:e6f006238034
- Python results plotting (finally).
- Proper results reporting script.
- Test on ALL talkers. The results script then generates a summary based on all the various subsets.
- Fixed chown users (hopefully sudos to be deleted entirely soon)
- More...
author | tomwalters |
---|---|
date | Mon, 13 Sep 2010 18:34:23 +0000 |
parents | 71c438f9daf7 |
children |
comparison
equal
deleted
inserted
replaced
380:0780b552b4bf | 381:e6f006238034 |
---|---|
1 % Plot a figure based on recognition data from the HTK-AIM features | 1 % Plot a figure based on recognition data from the HTK-AIM features |
2 % experiments - a reworking of the 'spider plots' by Jess Monaghan, | 2 % experiments - a reworking of the 'spider plots' by Jess Monaghan, |
3 % Nick Fyson and Martin Vestergaard. | 3 % Nick Fyson and Martin Vestergaard. |
4 % Copyright 2009 University of Cambridge | 4 % Copyright 2009 University of Cambridge |
5 % Author: Tom Walters <tcw24@cam> | 5 % Author: Tom Walters <tcw24@cam> |
6 function plot_all_results(exp_path) | 6 function plot_all_results(exp_path, iteration, plot_end_numbers) |
7 | |
8 plot_numbers = true; | |
9 if nargin < 3 | |
10 plot_end_numbers = false; | |
11 end | |
7 | 12 |
8 % Load the results from the experimental directory | 13 % Load the results from the experimental directory |
9 load([exp_path 'misclassified.txt_iter15']); | 14 misclassified = load([exp_path 'misclassified_syllables_iteration_' num2str(iteration)]); |
10 | 15 |
11 % The total number of syllables in the CNBH syllable database | 16 % The total number of syllables in the CNBH syllable database |
12 num_points = 185; | 17 num_points = 185; |
13 target_VTL = 15; | 18 target_VTL = 15; |
14 | 19 |
15 misclassified(:, 1) = 1 - misclassified(:, 1) / num_points; %#ok<NODEF> | 20 misclassified(:, 1) = 1 - misclassified(:, 1) / num_points; |
16 | 21 |
17 % The individual data points are plotted as spheres | 22 % The individual data points are plotted as spheres |
18 sphere_size_x = 1.2; | 23 sphere_size_x = 1.2; |
19 sphere_size_y = 0.17; | 24 sphere_size_y = 0.17; |
20 sphere_size_z = 2.5; | 25 sphere_size_z = 2.5; |
59 j=2; | 64 j=2; |
60 x_pos_2 = spokes{i}(j, 1); | 65 x_pos_2 = spokes{i}(j, 1); |
61 y_pos_2 = spokes{i}(j, 2); | 66 y_pos_2 = spokes{i}(j, 2); |
62 z_pos_2 = results{i}(j); | 67 z_pos_2 = results{i}(j); |
63 | 68 |
64 text(x_pos + 0.3*(x_pos - x_pos_2), y_pos + 0.3*(y_pos - y_pos_2), z_pos + 0.3*(z_pos - z_pos_2) , [num2str(results{i}(j), 3) '%']); | 69 j=1; |
70 | |
71 if (~plot_numbers && plot_end_numbers) | |
72 text(x_pos + 0.3*(x_pos - x_pos_2), y_pos + 0.3*(y_pos - y_pos_2), z_pos + 0.3*(z_pos - z_pos_2) , [num2str(results{i}(j), 3) '%']); | |
73 end | |
65 for j = 1:length(spokes{i}) | 74 for j = 1:length(spokes{i}) |
66 [X Y Z] = sphere(10); | 75 if (plot_numbers) |
67 X = sphere_size_x.*X + spokes{i}(j,1); | 76 text(spokes{i}(j,1), spokes{i}(j,2), results{i}(j), [num2str(results{i}(j), 3) '%']); |
68 Y = sphere_size_y.*Y + spokes{i}(j,2); | 77 else |
69 Z = sphere_size_z.*Z + results{i}(j); | 78 [X Y Z] = sphere(10); |
70 % C = zeros(size(X)); | 79 X = sphere_size_x.*X + spokes{i}(j,1); |
71 plot3([spokes{i}(j, 1) spokes{i}(j, 1)], ... | 80 Y = sphere_size_y.*Y + spokes{i}(j,2); |
72 [spokes{i}(j, 2),spokes{i}(j, 2)], [0 results{i}(j)], '-k.', ... | 81 Z = sphere_size_z.*Z + results{i}(j); |
73 'LineWidth', 1, 'Color', [0.8 0.8 0.8]); | 82 % C = zeros(size(X)); |
74 surf(X, Y, Z, ones(size(Z)) .* (results{i}(j)), 'LineStyle', 'none'); | 83 plot3([spokes{i}(j, 1) spokes{i}(j, 1)], ... |
84 [spokes{i}(j, 2),spokes{i}(j, 2)], [0 results{i}(j)], '-k.', ... | |
85 'LineWidth', 1, 'Color', [0.8 0.8 0.8]); | |
86 surf(X, Y, Z, ones(size(Z)) .* (results{i}(j)), 'LineStyle', 'none'); | |
87 end | |
75 end | 88 end |
76 plot3(spokes{i}(:,1), spokes{i}(:,2), results{i}(:), '-', 'LineWidth', 2, ... | 89 if (~plot_numbers) |
77 'Color', [0.2 0.2 0.2]); | 90 plot3(spokes{i}(:,1), spokes{i}(:,2), results{i}(:), '-', 'LineWidth', 2, ... |
91 'Color', [0.2 0.2 0.2]); | |
92 end | |
78 end | 93 end |
79 % Plot a zero-sized sphere at zero to get the autoscaling of the colour bar | 94 % Plot a zero-sized sphere at zero to get the autoscaling of the colour bar |
80 % correct | 95 % correct |
81 [X Y Z] = sphere(20); | 96 [X Y Z] = sphere(20); |
82 X = zeros(size(X)) - 1; | 97 X = zeros(size(X)) - 1; |
97 set(axes1, 'XTick', [132 172 224]); | 112 set(axes1, 'XTick', [132 172 224]); |
98 set(axes1, 'YTick', [10 15 22]); | 113 set(axes1, 'YTick', [10 15 22]); |
99 set(axes1, 'YDir', 'reverse'); | 114 set(axes1, 'YDir', 'reverse'); |
100 set(axes1, 'ZTick', [0 20 40 60 80 100]); | 115 set(axes1, 'ZTick', [0 20 40 60 80 100]); |
101 hold('all'); | 116 hold('all'); |
102 print('-depsc', 'results_plot.eps'); | 117 %print('-depsc', [exp_path 'results_plot_iteration_' num2str(iteration) '.eps']); |
103 !open results_plot.eps | 118 % saveas(gcf, [exp_path 'results_plot_iteration_' num2str(iteration) '.fig']); |
119 %!open results_plot.eps | |
104 | 120 |
105 | 121 |
106 | 122 |