|
88 | 88 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
89 | 89 |
|
90 | 90 | total_data_count = length(dataA);
|
91 |
| -% counting points located within polygon extent |
92 |
| -for i = 1: size(f2,1) |
93 |
| - |
94 |
| -inpoly_data_count = inpolygon(x, y,v(f2(i,:),1),v(f2(i,:),2)); |
95 |
| -density_i(i,1) = sum(inpoly_data_count)/total_data_count; |
96 |
| - |
| 91 | +% count points located within polygon extent |
| 92 | +for i = 1:size(f2, 1) |
| 93 | + inpoly_data_count = inpolygon(x, y, v(f2(i, :), 1), v(f2(i, :), 2)); |
| 94 | + density_i(i, 1) = sum(inpoly_data_count)/total_data_count; |
97 | 95 | end
|
98 | 96 | %
|
99 |
| -% specifying the RGB ranges of the colorbar (here grey scale is applied) |
| 97 | +% specify the RGB ranges of the colorbar (here grey scale is applied) |
100 | 98 | c_mat_down = 0;
|
101 |
| -c_mat_up = round(1.05*max(density_i),2,'significant'); |
102 |
| -c_mat = [linspace(1,0,num_color_classes-1)',linspace(1,0,num_color_classes-1)',linspace(1,0,num_color_classes-1)']; |
103 |
| -c_mat_1 = linspace(c_mat_down,c_mat_up,size(c_mat,1)+1)'; |
104 |
| -c_mat = [c_mat_1(1:end-1),c_mat_1(2:end),c_mat]; |
| 99 | +c_mat_up = round(1.05*max(density_i), 2, 'significant'); |
| 100 | +c_mat = repmat(linspace(1, 0, num_color_classes-1)', 1, 3); |
| 101 | +c_mat_1 = linspace(c_mat_down, c_mat_up, size(c_mat,1) + 1)'; |
| 102 | +c_mat = [c_mat_1(1:end-1), c_mat_1(2:end), c_mat]; |
105 | 103 | %
|
106 |
| -% Plotting Ternary Diagram |
| 104 | +% Plot Ternary Diagram |
107 | 105 | hfinal = figure;
|
108 |
| -ternplot(dataA, dataB, dataC,'majors', 10,'.','color','none') % here the 'majors' is fixed to 10 to avoid text-lable interruption. |
| 106 | +% here the 'majors' is fixed to 10 to avoid text-lable interruption. |
| 107 | +ternplot(dataA, dataB, dataC, 'majors', 10, '.', 'color', 'none') |
109 | 108 | set(gca, 'visible', 'off');
|
110 | 109 | hold on
|
111 | 110 | for i = 1: size(f2,1)
|
|
0 commit comments