Index: trunk/src/mouse_motion.m
===================================================================
--- trunk/src/mouse_motion.m	(revision 859)
+++ trunk/src/mouse_motion.m	(revision 862)
@@ -232,16 +232,17 @@
             if test_piv
                [dd,ind_pt]=min(abs(Field.X-xy(1,1))+abs(Field.Y-xy(1,2)));
-               if (isfield(hhciv,'TestCiv2')&& get(hhciv.TestCiv2,'Value'))% if TestCiv2 is activated
+               if isfield(hhciv,'TestCiv2') && strcmp(get(hhciv.Civ2,'Visible'),'on')&& ...
+                                     strcmp(get(hhciv.TestCiv2,'Visible'),'on')&& get(hhciv.TestCiv2,'Value')% if TestCiv2 is activated
                    CivOption='Civ2';
                    Param.CheckCiv1=0;
                    par_civ=read_GUI(hhciv.Civ2);%read the Civ2 panel in civ_input
-                   par_civ.Civ1_SubRange=Field.Civ1_SubRange;
-                   par_civ.Civ1_NbCentres=Field.Civ1_NbCentres;
-                   par_civ.Civ1_Coord_tps=Field.Civ1_Coord_tps;
-                   par_civ.Civ1_U_tps=Field.Civ1_U_tps;
-                   par_civ.Civ1_V_tps=Field.Civ1_V_tps;
+                   par_civ.Civ1_SubRange=Field.Civ1_SubRange;% get the subranges used for patch
+                   par_civ.Civ1_NbCentres=Field.Civ1_NbCentres;% get the nbre of civ1 data points in each subrange
+                   par_civ.Civ1_Coord_tps=Field.Civ1_Coord_tps;% get the positions of the centres (Civ1 data)
+                   par_civ.Civ1_U_tps=Field.Civ1_U_tps;% get the tps coefficients for spline, U component
+                   par_civ.Civ1_V_tps=Field.Civ1_V_tps;% get the tps coefficients for spline, V component
                    par_civ.Civ1_Dt=Field.Civ1_Dt;
                    par_civ.Civ2_Dt=Field.Civ2_Dt;
-                   shiftx=Field.ShiftX(ind_pt);
+                   shiftx=Field.ShiftX(ind_pt);% get field info stored in the cuirrent figure
                    shifty=Field.ShiftY(ind_pt);
                else
@@ -306,10 +307,12 @@
                         if ~isempty(corrfig)
                             set(0,'CurrentFigure',corrfig(1))
-                            AxeData.CurrentCorrImage=imagesc(rangx,-rangy,result_conv,[0 1]);
+                            AxeData.CurrentCorrImage=imagesc(rangx,-rangy,result_conv,[0 1]);% plot the correlation map, with full colormap from 0 to 1
                             AxeData.CurrentVector=line([0 Data.([CivOption '_U'])],[0 Data.([CivOption '_V'])],'Tag','vector');
-                            AxeData.TitleHandle=title(num2str(par_civ.Grid));
+                            AxeData.TitleHandle=title(['[x,y]= ' num2str(par_civ.Grid) ' px']);
                             colorbar
                             set(CurrentAxes,'UserData',AxeData)
-                            set(get(AxeData.CurrentCorrImage,'parent'),'YDir','normal')
+                            ParentAxe=get(AxeData.CurrentCorrImage,'parent');
+                            set(ParentAxe,'YDir','normal')
+                             set(ParentAxe,'DataAspectRatio',[1 1 1]); %equal axis scale
                         end
                     else
@@ -317,6 +320,13 @@
                         set(AxeData.CurrentCorrImage,'XData',rangx)
                         set(AxeData.CurrentCorrImage,'YData',-rangy)
+                        ParentAxe=get(AxeData.CurrentCorrImage,'parent');
+                        rangx(1)=min(rangx(1),0);
+                        rangx(2)=max(rangx(2),0);
+                        rangy(2)=max(rangy(2),0);
+                        rangy(1)=min(rangy(1),0);
+                         set(ParentAxe,'XLim',rangx)
+                         set(ParentAxe,'YLim',[-rangy(2) -rangy(1)])
                         set(AxeData.CurrentVector,'XData',[0 Data.([CivOption '_U'])],'YData',[0 Data.([CivOption '_V'])]);
-                        set(AxeData.TitleHandle,'String',num2str(par_civ.Grid))
+                        set(AxeData.TitleHandle,'String',['[x,y]= ' num2str(par_civ.Grid) ' px'])
                     end
                 end
