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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
| function plotGui3
%load SpeciesStar1
% on cree et on cache GUI pendant sa construction:
f=figure('Visible','off','Position',[125,125,600,400]);
% construction des uicontrol:
PopLat=uicontrol('style','popup',...
'units','normalized',...
'position',[.1 .4 .2 .5],...
'string',{'[-90 -70[' '[-70 -50[' '[-50 -30[' '[-30 -10[' '[-10 10[' '[10 30[' '[30 50[' '[50 70[' '[70 90['},...
'callback',@popLat_menu_callback,...
'tag','lat');
PopMois=uicontrol('style','popup',...
'units','normalized',...
'position',[.1 .37 .2 .47],...
'string',{'Septembre 2002' 'Octobre 2002' 'Novembre 2002' 'Decembre 2002'},...
'callback',@popMois_menu_callback,...
'tag','mois');
PushPlot=uicontrol('style','pushbutton',...
'units','normalized',...
'position',[.1 .6 .2 .1],...
'string','plot',...
'callback',@vasyPlot,...
'tag','plot');
ha=axes('Units','normalized','position',[.4 .25 .5 .7]);
align([PopLat,PopMois,PushPlot],'Center','none');
% initialisation de GUI
% On change les unites comme ça, les composantes se resizent automatiquement
set([f,PopLat,PopMois,PushPlot],'units','normalized');
set(f,'name','beinAlors');
set(f,'visible','on');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% debut de PopUpLat Callback function %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function LatIndex=popLat_menu_callback(obj,event)
str=get(obj,'string');
val=get(obj,'value');
switch str{val};
case '[-90 -70['
LatIndex=1;
case '[-70 -50['
LatIndex=2;
case '[-50 -30['
LatIndex=3;
case '[-30 -10['
LatIndex=4;
case '[-10 10['
LatIndex=5;
case '[10 30['
LatIndex=6;
case '[30 50['
LatIndex=7;
case '[50 70['
LatIndex=8;
case '[70 90['
LatIndex=9;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% fin de PopUpLat Callback function %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% debut de PopUpMois Callback function %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function MoisIndex=popMois_menu_callback(obj,event)
str2=get(obj,'string');
val2=get(obj,'value');
switch str2{val2};
case 'Septembre 2002'
MoisIndex=1;
case 'Octobre 2002'
MoisIndex=2;
case 'Novembre 2002'
MoisIndex=3;
case 'Decembre 2002'
MoisIndex=4;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% fin de PopUpMois Callback function %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Debut de Pushbutton callback function %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function vasyPlot(obj,event,LatIndex,MoisIndex)
y=SpeciesBin{LatIndex,MoisIndex}(:,1);
x=SpeciesBin{LatIndex,MoisIndex}(:,10);
semilogx(x,y,'r-o')
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fin de Pushbutton callback function %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end |
Partager