Index: /trunk/src/mouse_down.m
===================================================================
--- /trunk/src/mouse_down.m	(revision 209)
+++ /trunk/src/mouse_down.m	(revision 210)
@@ -72,4 +72,5 @@
 
 %% loop on all the objects in the current figure (selected by the last mouse click) 
+%CurrentOrigin=get(hObject,'CurrentPoint')
 for ichild=1:length(hchild)
     obj_pos=get(hchild(ichild),'Position');%position of the object
Index: /trunk/src/mouse_up.m
===================================================================
--- /trunk/src/mouse_up.m	(revision 209)
+++ /trunk/src/mouse_up.m	(revision 210)
@@ -248,10 +248,10 @@
 end
 
-%% zoom in by a factor 2 if no new figure is created
+%% zoom in or out by a factor 2 if no new figure is created
 if test_zoom
     xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
     xlim=get(currentaxes,'XLim');
     ylim=get(currentaxes,'YLim');
-    if  isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed
+    if  isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2
         xlim(1)=0.5*xy(1,1)+0.5*xlim(1);
         xlim(2)=0.5*xy(1,1)+0.5*xlim(2);
@@ -268,5 +268,5 @@
         %             ylim_new(1)=(1+alpha)*ylim(1)/2+(1-alpha)*ylim(2)/2;
         %             ylim_new(2)=(1-alpha)*ylim(1)/2+(1+alpha)*ylim(2)/2;
-        if isfield(AxeData,'RangeX') && isfield(AxeData,'RangeY')
+        if isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY')
             xlim(1)=max(AxeData.RangeX(1),xlim(1));
             xlim(2)=min(AxeData.RangeX(2),xlim(2));
@@ -276,6 +276,6 @@
                 set(hhuvmat.zoom,'Value',0)
                 set(hhuvmat.zoom,'BackgroundColor',[0.7 0.7 0.7])
-                set(hhuvmat.FixedLimits,'Value',0)
-                set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
+                set(hhuvmat.FixLimits,'Value',0)
+                set(hhuvmat.FixLimits,'BackgroundColor',[0.7 0.7 0.7])
             end
         end
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 209)
+++ /trunk/src/plot_field.m	(revision 210)
@@ -241,6 +241,8 @@
 end
 if isfield(PlotParamOut,'MinX')
-set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
-set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
+    set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
+    set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
+    AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX];
+    AxeData.RangeY=[PlotParamOut.MinY PlotParamOut.MaxY];
 end
 
@@ -522,5 +524,4 @@
 function [haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,PosColorbar)
 %-------------------------------------------------------------------
-
 grid(haxes, 'off')
 %default plotting parameters
@@ -756,8 +757,8 @@
             Aline=Aline(~isnan(A));
             if isempty(Aline)
-                 errormsg=['NaN input scalar or image in plot_field'];
+                 errormsg='NaN input scalar or image in plot_field';
                 return
             end
-            MinA=double(min(Aline))
+            MinA=double(min(Aline));
             %MinA=double(min(min(A)));
         else
@@ -769,9 +770,9 @@
                Aline=Aline(~isnan(A));
                if isempty(Aline)
-                 errormsg=['NaN input scalar or image in plot_field'];
+                 errormsg='NaN input scalar or image in plot_field';
                 return
                end
             end
-            MaxA=double(max(Aline))
+            MaxA=double(max(Aline));
            % MaxA=double(max(max(A)));
         else
@@ -969,10 +970,9 @@
     vec_V=reshape(vec_V,1,numel(vec_V));
      MinMaxX=max(vec_X)-min(vec_X);
-    if  ~isfield(PlotParam.Vectors,'AutoVec') || isequal(PlotParam.Vectors.AutoVec,0)|| ~isfield(PlotParam.Vectors,'VecScale')...
-               ||isempty(PlotParam.Vectors.VecScale)||~isa(PlotParam.Vectors.VecScale,'double') %automatic vector scale
-%         scale=[];
-        if test_false %remove false vectors
-            %indsel=find(AxeData.FF==0);%indsel =indices of good vectors
-        else     
+    if  isfield(PlotParam.Vectors,'FixVec') && isequal(PlotParam.Vectors.FixVec,1)&& isfield(PlotParam.Vectors,'VecScale')...
+               &&~isempty(PlotParam.Vectors.VecScale) && isa(PlotParam.Vectors.VecScale,'double') %fixed vector scale
+        scale=PlotParam.Vectors.VecScale;  %impose the length of vector representation
+    else
+        if ~test_false %remove false vectors    
             indsel=1:numel(vec_X);%
         end
@@ -990,7 +990,5 @@
             PlotParam.Vectors.VecScale=scale;%update the 'scale' display
         end
-    else
-        scale=PlotParam.Vectors.VecScale;  %impose the length of vector representation
-    end;
+    end
     
     %record vectors on the plotting axes
@@ -1033,13 +1031,15 @@
        colorlist(nbcolor,:)=[0 0 0]; %add black to the list of colors
        if ~isempty(ivar_FF)
-            ind_flag=find(vec_F~=1 & vec_F~=0 & vec_FF==0);  %flag warning but not false
+          %  ind_flag=find(vec_F~=1 & vec_F~=0 & vec_FF==0);  %flag warning but not false
+            col_vec(vec_F~=1 & vec_F~=0 & vec_FF==0)=nbcolor;
        else
-            ind_flag=find(vec_F~=1 & vec_F~=0);
+           % ind_flag=find(vec_F~=1 & vec_F~=0);
+            col_vec(vec_F~=1 & vec_F~=0)=nbcolor;
        end
-       col_vec(ind_flag)=nbcolor;    
+      % col_vec(ind_flag)=nbcolor;    
     end
     nbcolor=nbcolor+1;
     if ~isempty(ivar_FF)
-        ind_flag=find(vec_FF~=0);
+        %ind_flag=find(vec_FF~=0);
         if isfield(PlotParam.Vectors,'HideFalse') && PlotParam.Vectors.HideFalse==1
             colorlist(nbcolor,:)=[NaN NaN NaN];% no plot of false vectors
@@ -1047,5 +1047,5 @@
             colorlist(nbcolor,:)=[1 0 1];% magenta color
         end
-        col_vec(ind_flag)=nbcolor;
+        col_vec(vec_FF~=0)=nbcolor;
     end
     %plot vectors:
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 209)
+++ /trunk/src/uvmat.m	(revision 210)
@@ -2389,7 +2389,5 @@
     return
 end
-'testUVMAT'
-UvData.Field
-[CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(UvData.Field)
+[CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(UvData.Field);
 if ~isempty(errormsg)
     errormsg=['error in uvmat/refresh_field/find_field_indices: ' errormsg];
@@ -2397,5 +2395,7 @@
 end
 [NbDim,imax]=max(NbDim);
-VarType{imax}
+if isfield(UvData.Field,'NbDim')
+    NbDim=UvData.Field.NbDim;% deal with plane fields containing z coordinates
+end
 if ~isempty(VarType{imax}.coord_x)  && ~isempty(VarType{imax}.coord_y)    %unstructured coordinates
     XName=UvData.Field.ListVarName{VarType{imax}.coord_x};
@@ -3019,5 +3019,5 @@
 end
 if numel(RootFile_1)>=1
-    if ~(isequal(RootFile_1(1),'/')|isequal(RootFile_1(1),'\'))
+    if ~(isequal(RootFile_1(1),'/')||isequal(RootFile_1(1),'\'))
         RootFile_1(1)=[];%suppress possible / or \ separator
     end
@@ -3176,5 +3176,5 @@
 [FileName,RootPath,FileBase,FileIndices,FileExt_prev]=read_file_boxes_1(handles);
 [P,F,str1,str2,str_a,str_b,E,NomType]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_prev]);
-if isempty(FileExt_prev)|isequal(FileExt_prev,'')
+if isempty(FileExt_prev)|| strcmp(FileExt_prev,'')
     FileExt_1=get(handles.FileExt,'String');
 else
@@ -3182,5 +3182,5 @@
 end
 NomType_1=get(handles.FileIndex_1,'UserData');
-if isempty(NomType_1)|isequal(NomType_1,'')
+if isempty(NomType_1)|| strcmp(NomType_1,'')
     NomType_1=get(handles.FileIndex,'UserData');
 end
@@ -4314,5 +4314,5 @@
     ObjectData.enable_plot=1;
 else
-	if isfield(ObjectData,'enable_plot')
+    if isfield(ObjectData,'enable_plot')
         ObjectData=rmfield(ObjectData,'enable_plot');
     end
