Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 185)
+++ /trunk/src/plot_field.m	(revision 186)
@@ -112,5 +112,8 @@
 PlotType='text'; %default
 PlotParamOut=PlotParam;%default
-
+if isempty(Data)
+    PlotType='none';
+   return
+end
 % check input structure
 [Data,errormsg]=check_field_structure(Data);
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 185)
+++ /trunk/src/proj_field.m	(revision 186)
@@ -385,15 +385,19 @@
 %A REVOIR, GENERALISER: UTILISER proj_line
 ProjData.NbDim=1;
-%ProjData.ListDimName={};%name of dimension 
-%ProjData.DimValue=[];%values of dimension (nbre of vectors)
 ProjData.ListVarName={};
-%ProjData.VarDimIndex={};
 ProjData.VarDimName={};
-if isfield (FieldData,'ListVarAttribute')
-    ProjData.ListVarAttribute=FieldData.ListVarAttribute;%list of variable attribute names
-    for iattr=1:length(ProjData.ListVarAttribute)%initialization of variable attribute values
-        AttrName=ProjData.ListVarAttribute{iattr};
-        eval(['ProjData.' AttrName '={};'])
-    end;
+
+Mesh=zeros(1,numel(FieldData.ListVarName));
+if isfield (FieldData,'VarAttribute')
+    ProjData.VarAttribute=FieldData.VarAttribute;%list of variable attribute names
+    for iattr=1:length(ProjData.VarAttribute)%initialization of variable attribute values
+%         ProjData.VarAttribute{iattr}={};
+        if isfield(ProjData.VarAttribute{iattr},'Unit')
+            unit{iattr}=ProjData.VarAttribute{iattr}.Unit;
+        end
+        if isfield(ProjData.VarAttribute{iattr},'Mesh')
+            Mesh(iattr)=ProjData.VarAttribute{iattr}.Mesh;
+        end
+    end
 end
 
@@ -449,5 +453,5 @@
     % image or 2D matrix
     if numel(VarType.coord)>=2 & VarType.coord(1:2) > 0;
-        test_Amat=1;%image or 2D matrix
+        test_Amat=1;% test for image or 2D matrix
         AYName=FieldData.ListVarName{VarType.coord(1)};
         AXName=FieldData.ListVarName{VarType.coord(2)};
@@ -456,15 +460,19 @@
         VarName=FieldData.ListVarName{VarIndex(1)};
         eval(['DimValue=size(FieldData.' VarName ');'])
+       if length(AX)==2
+           AX=linspace(AX(1),AX(end),DimValue(2));
+       end
+       if length(AY)==2
+           AY=linspace(AY(1),AY(end),DimValue(1));
+       end
+%         for idim=1:length(DimValue)        
+%             Coord_i_str=['Coord_' num2str(idim)];
+%             DCoord_min(idim)=1;%default
+%             Coord{idim}=[0.5 DimValue(idim)];
+%             test_direct(idim)=1;
+%         end
+%         AX=linspace(Coord{2}(1),Coord{2}(2),DimValue(2));
+%         AY=linspace(Coord{1}(1),Coord{1}(2),DimValue(1));  %TODO : 3D case 
         testcolor=find(numel(DimValue)==3);
-%                     errormsg='multicomponent field not projected';
-
-        for idim=1:length(DimValue)        
-            Coord_i_str=['Coord_' num2str(idim)];
-            DCoord_min(idim)=1;%default
-            Coord{idim}=[0.5 DimValue(idim)];
-            test_direct(idim)=1;
-        end
-        AX=linspace(Coord{2}(1),Coord{2}(2),DimValue(2));
-        AY=linspace(Coord{1}(1),Coord{1}(2),DimValue(1));  %TODO : 3D case 
         if length(DimValue)==3
             testcolor=1;
@@ -533,5 +541,12 @@
             VarName=FieldData.ListVarName{ivar};
             eval(['ProjData.' VarName 'Mean=mean(mean(double(FieldData.' VarName '(indsel,:))));']); % keep only non false vectors
-            eval(['[ProjData.' VarName 'Histo,ProjData.' VarName ']=hist(double(FieldData.' VarName '(indsel,:)),100);']); % keep only non false vectors 
+            eval(['ProjData.' VarName 'Min=min(min(double(FieldData.' VarName '(indsel,:))));']); % keep only non false vectors
+            eval(['ProjData.' VarName 'Max=max(max(double(FieldData.' VarName '(indsel,:))));']); % keep only non false vectors
+            if isequal(Mesh(ivar),0)
+                eval(['[ProjData.' VarName 'Histo,ProjData.' VarName ']=hist(double(FieldData.' VarName '(indsel,:)),100);']); % default histogram with 100 bins
+            else
+                eval(['ProjData.' VarName '=(ProjData.' VarName 'Min+Mesh(ivar)/2:Mesh(ivar):ProjData.' VarName 'Max);']); % list of bin values
+                eval(['ProjData.' VarName 'Histo=hist(double(FieldData.' VarName '(indsel,:)),ProjData.' VarName ');']); % histogram at predefined bin positions
+            end
             ProjData.ListVarName=[ProjData.ListVarName {VarName} {[VarName 'Histo']} {[VarName 'Mean']}];
             if test_Amat && testcolor
@@ -550,5 +565,4 @@
 %     end
 end
-
 
 
@@ -1759,7 +1773,7 @@
             end  
         elseif isequal(ObjectData.ProjMode,'interp')||isequal(ObjectData.ProjMode,'filter')%interpolate data on a regular grid
-            coord_x_proj=[XMin:DX:XMax];
-            coord_y_proj=[YMin:DY:YMax];
-            coord_z_proj=[ZMin:DZ:ZMax];
+            coord_x_proj=(XMin:DX:XMax);
+            coord_y_proj=(YMin:DY:YMax);
+            coord_z_proj=(ZMin:DZ:ZMax);
             [XI,YI,ZI]=meshgrid(coord_x_proj,coord_y_proj,coord_z_proj);
             DimCell={'coord_y','coord_x'};
Index: /trunk/src/read_civxdata.m
===================================================================
--- /trunk/src/read_civxdata.m	(revision 185)
+++ /trunk/src/read_civxdata.m	(revision 186)
@@ -70,4 +70,5 @@
 for ivar=1:length(var_ind)
     Field.VarAttribute{ivar}.Role=role{var_ind(ivar)};
+     Field.VarAttribute{ivar}.Mesh=0.1;%typical mesh for histograms O.1 pixel
 %     Field.VarAttribute{ivar}.units=units{var_ind(ivar)};% not necessary: set with calc_field
 end
Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 185)
+++ /trunk/src/read_field.m	(revision 186)
@@ -165,4 +165,5 @@
             ParamOut.Npx=npxy(2);% display image size on the interface
             ParamOut.Npy=npxy(1);
+            Field.VarAttribute{3}.Mesh=1;
         else
             Field.NbDim=3;
@@ -174,4 +175,5 @@
             ParamOut.Npx=npxy(3);% display image size on the interface
             ParamOut.Npy=npxy(2);
+            Field.VarAttribute{4}.Mesh=1;
         end
     else
@@ -181,4 +183,5 @@
         ParamOut.Npx=npxy(2);% display image size on the interface
         ParamOut.Npy=npxy(1);
+        Field.VarAttribute{3}.Mesh=1;
     end
     Field.A=A;
Index: /trunk/src/set_object.m
===================================================================
--- /trunk/src/set_object.m	(revision 185)
+++ /trunk/src/set_object.m	(revision 186)
@@ -702,4 +702,5 @@
 end
 testnew=0;
+ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object
 PlotHandles=get_plot_handles(hhuvmat);
 projview='view_field';%default
@@ -723,9 +724,10 @@
     if isempty(hview_field)
         hview_field=view_field;
+%     elseif strcmp(ObjectData.ProjMode,'none')||strcmp(ObjectData.ProjMode,'mask_inside')||strcmp(ObjectData.ProjMode,'mask_outside')
     end
     PlotHandles=guidata(hview_field);
     plotaxes=PlotHandles.axes3;%handle of axes3 in view_field
 end   
-ObjectData=read_set_object(handles);%read the input parameters defining the object in the GUI set_object
+
 
 %% naming the object
