Index: trunk/SophyaPI/PIext/pawexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/pawexecut.cc	(revision 2679)
+++ trunk/SophyaPI/PIext/pawexecut.cc	(revision 2681)
@@ -19,4 +19,5 @@
 #include "nomgadapter.h"
 #include "pistdimgapp.h"
+#include "pihisto.h"
 
 #ifdef SANS_EVOLPLANCK
@@ -45,9 +46,12 @@
 
 kw = "n/plot";
-usage = "Plot NTuple variables a la paw (alias n/pl)";
+usage = "Plot NTuple variables \"a la paw\" (alias n/pl)";
 usage += "\n n/plot nameobj.x_exp [cut] [w_exp] [loop] [gratt]";
 usage += "\n n/plot nameobj.y_exp%x_exp [cut] [loop] [gratt]";
 usage += "\n n/plot nameobj.z_exp%y_exp%x_exp [cut] [loop] [gratt]";
 usage += "\n        for default use ! , loop=i1[:i2[:di]]";
+usage += "\n for 1 dimensional (1D) projection:";
+usage += "\n   use graphic option \"keepbin\" to superimpose";
+usage += "\n   1D distribution with the same binning";
 usage += "\n  Related commands: plot2dw plot3d";  
 piac->RegisterCommand(kw,usage,this,hgrp);
@@ -58,4 +62,7 @@
 usage += "\n n/proj nameproj nameobj.y_exp%x_exp [cut] [w_exp] [loop] [gratt]";
 usage += "\n        for default use ! , loop=i1[:i2[:di]]";
+usage += "\n for 1 dimensional (1D) projection:";
+usage += "\n   no display is performed if \"nameproj\" is an existing histogram";
+usage += "\n   unless a graphic option \"gratt\" is given";
 usage += "\n  Related commands: projh1d projh2d projprof exptovec";  
 piac->RegisterCommand(kw,usage,this,hgrp);
@@ -375,4 +382,30 @@
       nameproj += buff;
     }
+    // --- Si option "keepbin" on projete avec le meme binning que l'histo 1D precedent
+    if(dopt.find("keepbin")<dopt.size()) {
+      PIStdImgApp* piimapp = omg.GetImgApp();
+      if(piimapp) {
+	PIBaseWdg* pibwdg = piimapp->CurrentBaseWdg();
+	if(pibwdg) {
+          int nbdrw = pibwdg->NbDrawers();
+          if(nbdrw>0) {
+            for(int i=nbdrw-1;i>=0;i--) {
+              PIDrawer* pidwr = pibwdg->GetDrawer(i);
+              PIHisto* pih = NULL;
+              if( (pih = dynamic_cast<PIHisto *>(pidwr))==NULL ) continue;
+              Histo* h = pih->Histogram();
+              if(h==NULL) continue;
+              if(h->NBins()<1) continue;
+              Histo* hsame = new Histo(h->XMin(),h->XMax(),h->NBins());
+              omg.AddObj(hsame,nameproj);
+              // on force donc le display sur le meme plot
+              dopt += " same";
+              break;
+	    }
+	  }
+	}
+      }
+    }
+    // --- 
   }
   srvo->ProjectH1(nameobj,expx,expwt,expcut,nameproj,dopt,loop);
Index: trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.cc	(revision 2679)
+++ trunk/SophyaPI/PIext/servnobjm.cc	(revision 2681)
@@ -500,5 +500,5 @@
   cout << "Services2NObjMgr::ProjectH1() Error , No such object " << nom << endl; 
   return;
-  }
+}
 if (!mImgapp)  return; 
 
@@ -516,5 +516,5 @@
   char* ntn[2]= {"hxval", "hwt"};
   nt = new NTuple(2,ntn);  // Creation NTuple 
-  }
+}
 string expz = "0.";   
 ComputeExpressions(obja, expx, expwt, expz, expwt, expcut, loop, nt, h1, NULL);
@@ -526,5 +526,5 @@
     delete nt;
     return;
-    }
+  }
   double xmin, xmax;
   nt->GetMinMax(0, xmin, xmax);
@@ -535,10 +535,10 @@
     xn = nt->GetVec(k);
     h1->Add(xn[0], xn[1]);    
-    }
+  }
   delete nt;
   MyObjMgr()->AddObj(h1, nomh1);
-  }
-
-if(!h1_already_exist) MyObjMgr()->DisplayObj(nomh1, dopt);
+}
+
+if(!h1_already_exist || dopt.size()>0) MyObjMgr()->DisplayObj(nomh1, dopt);
 return;  
 }
@@ -553,5 +553,5 @@
   cout << "Services2NObjMgr::ProjectH2() Error , No such object " << nom << endl; 
   return;
-  }
+}
 if (!mImgapp)  return; 
 
@@ -569,5 +569,5 @@
   char* ntn[3]= {"hxval", "hyval", "hwt"};
   nt = new NTuple(3,ntn);  // Creation NTuple 
-  }
+}
 string expz = "0.";   
 ComputeExpressions(obja, expx, expy, expwt, expwt, expcut, loop, nt, NULL, h2);
@@ -579,5 +579,5 @@
     delete nt;
     return;
-    }
+  }
   double xmin, xmax, ymin, ymax;
   nt->GetMinMax(0, xmin, xmax);
@@ -589,10 +589,10 @@
     xn = nt->GetVec(k);
     h2->Add(xn[0], xn[1], xn[2]);    
-    }
+  }
   delete nt;
   MyObjMgr()->AddObj(h2, nomh2);
-  }
-
-if(!h2_already_exist) MyObjMgr()->DisplayObj(nomh2, dopt);
+}
+
+if(!h2_already_exist || dopt.size()>0) MyObjMgr()->DisplayObj(nomh2, dopt);
 return;  
 
@@ -618,5 +618,5 @@
   cout << "Services2NObjMgr::ProjectHProf() Error , No such object " << nom << endl; 
   return;
-  }
+}
 if (!mImgapp)  return; 
 
@@ -652,11 +652,11 @@
     xn = nt->GetVec(k);
     hprof->Add(xn[0], xn[1], xn[2]);
-    }
+  }
   delete nt;
   MyObjMgr()->AddObj(hprof, nomprof);
-  }
+}
 hprof->UpdateHisto();
 
-if(!hp_already_exist) MyObjMgr()->DisplayObj(nomprof, dopt);
+if(!hp_already_exist || dopt.size()>0) MyObjMgr()->DisplayObj(nomprof, dopt);
 return;
 }
