1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
%%%%%%%%%%%%%%
%% FIGURE 1 %%
%%%%%%%%%%%%%%
M = [11,12 ; 21,22 ; 31,32];
R = [13,14 ; 23,24 ; 33,34];
D = [360;275;265;180]
H = [1.5;2.5]
S = size(M);
figure
hold on
for x = 1:3
Ymin = 1;
Ymax = 4;
line([x x],[Ymin Ymax],'linewidth',3)
end
for y = 1:4
Xmin = 1;
Xmax = 3;
line([Xmin Xmax],[y y],'linewidth',3)
end
%% Valeurs tableau
[X,Y] = meshgrid(2:S(2)+1,2:S(1)+1);
text(X(:)-.5,Y(:)-.5, num2str([M(:) R(:)],'%.1f%%\n \\color{red}%.1f%%'),...
'hor','center','vert','middle');
%% Légende à droite du tableau
[X,Y] = meshgrid(3.2,1:S(1)+1);
text(X(:),Y(:), num2str(D(:),'%.0f°%'),...
'hor','center','vert','middle');
%% Légende en bas du tableau
[X,Y] = meshgrid(1.5:S(2)+.5,4.2);
text(X(:),Y(:), num2str(H(:),'%.0f m%'),...
'hor','center','vert','middle');
set(gca,'Visible', 'off','xlim',[.5 S(2)+1.5],'ylim',[.5 S(1)+1.5], 'ydir', ...
'reverse','xticklabel','','yticklabel','')
saveas(gcf,'test','png')
%%%%%%%%%%%%%%
%% FIGURE 2 %%
%%%%%%%%%%%%%%
D=[100;200;1001;2001;3521;1520;235;5632;1544;2513]
% DebD MIN à prendre en compte :
Dmin = [0;1000;2000;3000;4000];
% DebD MAX à prendre en compte :
Dmax = [1000;2000;3000;4000;10000];
Dc={};
NbClasse = size(Dmin(:,1));
val=[];
NbValTot = size(D(:,1));
figure
hold on
for classe = 1:NbClasse
val=find(D >= Dmin(classe) & D < Dmax(classe));
% On initialise la date, le débit et le nombre de ligne :
Dc{classe}=D(val); % par chaque date "dat" comprise en dat1 et dat2,
Dmoy(classe) = mean(Dc{classe}(:,1));
NbValDc = size(Dc{classe}(:,1));
ProbOcc(classe) = NbValDc/NbValTot;
X = Dmoy(classe);
Ymax = ProbOcc(classe);
Ymin = 0;
C = ProbOcc(classe);
line([X, X],[Ymin, Ymax],'LineWidth',30,'Color',[.8 .2 0])
Xbis = X;
Ybis = Ymax + 0.025;
Str = num2str(X,'%.0f');
text(Xbis,Ybis,Str,'hor','center');
end
% Add title and axis labels
title('Titre');
xlabel('D');
ylabel(' ProbOcc ');
xlim([0 6000]);
saveas(gcf,'Test','png'); |
Partager