Index: trunk/SophyaPI/PIext/pihisto.cc
===================================================================
--- trunk/SophyaPI/PIext/pihisto.cc	(revision 1643)
+++ trunk/SophyaPI/PIext/pihisto.cc	(revision 1644)
@@ -137,27 +137,36 @@
   //  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
   g->SelLine(PI_ThinLine);
-  g->SelFontSz((YMax() - YMin())/25, mFAtt);
-//  double cellHeight = (YMax() - YMin()) * 0.05;
+  g->SelFontSz((YMax() - YMin())/30, mFAtt);
+
+  // La hauteur de la cellule
   PIGrCoord a, d;
   double cH = (double)g->GetFontHeight(a,d);
   double cellHeight = cH * 3.6;
-//  double cellWidth  = (XMax() - XMin()) * 0.23;
-  char label[50];
-  sprintf(label, "N= %8g    ", mHisto->NData());   label[11] ='\0';
-  double cellWidth =  (double)g->CalcStringWidth(label) * 1.1;
+
+  // Les labels et leurs longueurs -> largeur de la cellule
+  char *label, label1[32], label2[32], label3[32];
+  sprintf(label1, "N= %-6g",mHisto->NData());
+  sprintf(label2, "m= %-6g",mHisto->Mean());
+  sprintf(label3, "s= %-6g",mHisto->Sigma());
+  label = label1;
+  if(strlen(label)<strlen(label2)) label = label2;
+  if(strlen(label)<strlen(label3)) label = label3;
+  double cellWidth =  1.1 * (double)g->CalcStringWidth(label);
+
   double xu, yu;
+  // Les limites du cadre
   xu = g->DeltaUCX(XMax(), - cellWidth);
   yu = g->DeltaUCY(YMax(), - cellHeight);
   g->DrawLine(xu, YMax(), xu, yu);
   g->DrawLine(xu, yu, XMax(), yu);
+
+  // L'ecriture des labels
   xu = g->DeltaUCX(XMax(), - cellWidth*0.95);
   yu = g->DeltaUCY(YMax(), - cH*1.15);
-  g->DrawString(xu, yu, label);
-  sprintf(label, "m= %8g", mHisto->Mean());  label[11] ='\0';
+  g->DrawString(xu, yu, label1);
   yu = g->DeltaUCY(YMax(), - cH*2.3);
-  g->DrawString(xu, yu, label);
-  sprintf(label, "s= %8g", mHisto->Sigma());  label[11] ='\0';
+  g->DrawString(xu, yu, label2);
   yu = g->DeltaUCY(YMax(), - cH*3.45);
-  g->DrawString(xu, yu, label);
+  g->DrawString(xu, yu, label3);
                        
 }
Index: trunk/SophyaPI/PIext/pihisto2d.cc
===================================================================
--- trunk/SophyaPI/PIext/pihisto2d.cc	(revision 1643)
+++ trunk/SophyaPI/PIext/pihisto2d.cc	(revision 1644)
@@ -319,18 +319,27 @@
 //--
 {
-  // Une boite dans le coin superieur droit
+  if (!mHisto) return;
   if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
-  double cellHeight = (YMax() - YMin()) * 0.05;
-  double cellWidth  = (XMax() - XMin()) * 0.23;
+  g->SelFontSz((YMax() - YMin())/30, mFAtt);
+
+  // La hauteur de la cellule
+  PIGrCoord a, d;
+  double cellHeight = 1.2 * (double)g->GetFontHeight(a,d);
+
+  // Les labels et leurs longueurs -> largeur de la cellule
+  char label[32];
+  sprintf(label,"N= %-6g", mHisto->NData());
+  double cellWidth =  1.1 * (double)g->CalcStringWidth(label);
+
+  // Les limites du cadre
   g->DrawLine(XMax() - cellWidth, YMax(),
                        XMax() - cellWidth, YMax() - cellHeight);
   g->DrawLine(XMax() - cellWidth, YMax() - cellHeight,
                        XMax()            , YMax() - cellHeight);
-  char label[50];
-  sprintf(label, "N = %.6g", mHisto->NData());
-  g->SelFontSz((YMax() - YMin())/30);
-  g->DrawString(XMax() - cellWidth*0.9, YMax() - cellHeight*0.8, label);
-//  printf("H[%d,%d] Dynamique: [%g,%g] Frac [%g,%g]\n"
-//        ,mHisto->NBinX(),mHisto->NBinY(),HMin(),HMax(),FMin(),FMax());
+
+  // L'ecriture des labels
+  g->DrawString(XMax() - cellWidth*0.95, YMax() - cellHeight*0.8,label);
+  //  printf("H[%d,%d] Dynamique: [%g,%g] Frac [%g,%g]\n"
+  //        ,mHisto->NBinX(),mHisto->NBinY(),HMin(),HMax(),FMin(),FMax());
 }
 
Index: trunk/SophyaPI/PIext/pintuple.cc
===================================================================
--- trunk/SophyaPI/PIext/pintuple.cc	(revision 1643)
+++ trunk/SophyaPI/PIext/pintuple.cc	(revision 1644)
@@ -207,9 +207,9 @@
   char label[64];
   sprintf(label, "Nd= %d/ Ntot= %d", nok, mNT->NbLines());
-  g->SelFontSz((YMax() - YMin())/25, mFAtt);  
+  g->SelFontSz((YMax() - YMin())/30, mFAtt);  
   PIGrCoord a,d;
   double cH = (double)g->GetFontHeight(a,d);
-  double cellHeight = cH * 1.3;
-  double cellWidth =  (double)g->CalcStringWidth(label) * 1.1;
+  double cellHeight = cH * 1.2;
+  double cellWidth =   1.1 * (double)g->CalcStringWidth(label);
   double xu, yu;
   xu = g->DeltaUCX(XMax(), - cellWidth);
