Changeset 1644 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Aug 23, 2001, 7:51:29 PM (24 years ago)
Author:
cmv
Message:

amelioration impress Statistiques histo et histo2d cmv 23/8/2001

Location:
trunk/SophyaPI/PIext
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pihisto.cc

    r1090 r1644  
    137137  //  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    138138  g->SelLine(PI_ThinLine);
    139   g->SelFontSz((YMax() - YMin())/25, mFAtt);
    140 //  double cellHeight = (YMax() - YMin()) * 0.05;
     139  g->SelFontSz((YMax() - YMin())/30, mFAtt);
     140
     141  // La hauteur de la cellule
    141142  PIGrCoord a, d;
    142143  double cH = (double)g->GetFontHeight(a,d);
    143144  double cellHeight = cH * 3.6;
    144 //  double cellWidth  = (XMax() - XMin()) * 0.23;
    145   char label[50];
    146   sprintf(label, "N= %8g    ", mHisto->NData());   label[11] ='\0';
    147   double cellWidth =  (double)g->CalcStringWidth(label) * 1.1;
     145
     146  // Les labels et leurs longueurs -> largeur de la cellule
     147  char *label, label1[32], label2[32], label3[32];
     148  sprintf(label1, "N= %-6g",mHisto->NData());
     149  sprintf(label2, "m= %-6g",mHisto->Mean());
     150  sprintf(label3, "s= %-6g",mHisto->Sigma());
     151  label = label1;
     152  if(strlen(label)<strlen(label2)) label = label2;
     153  if(strlen(label)<strlen(label3)) label = label3;
     154  double cellWidth =  1.1 * (double)g->CalcStringWidth(label);
     155
    148156  double xu, yu;
     157  // Les limites du cadre
    149158  xu = g->DeltaUCX(XMax(), - cellWidth);
    150159  yu = g->DeltaUCY(YMax(), - cellHeight);
    151160  g->DrawLine(xu, YMax(), xu, yu);
    152161  g->DrawLine(xu, yu, XMax(), yu);
     162
     163  // L'ecriture des labels
    153164  xu = g->DeltaUCX(XMax(), - cellWidth*0.95);
    154165  yu = g->DeltaUCY(YMax(), - cH*1.15);
    155   g->DrawString(xu, yu, label);
    156   sprintf(label, "m= %8g", mHisto->Mean());  label[11] ='\0';
     166  g->DrawString(xu, yu, label1);
    157167  yu = g->DeltaUCY(YMax(), - cH*2.3);
    158   g->DrawString(xu, yu, label);
    159   sprintf(label, "s= %8g", mHisto->Sigma());  label[11] ='\0';
     168  g->DrawString(xu, yu, label2);
    160169  yu = g->DeltaUCY(YMax(), - cH*3.45);
    161   g->DrawString(xu, yu, label);
     170  g->DrawString(xu, yu, label3);
    162171                       
    163172}
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r1297 r1644  
    319319//--
    320320{
    321   // Une boite dans le coin superieur droit
     321  if (!mHisto) return;
    322322  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    323   double cellHeight = (YMax() - YMin()) * 0.05;
    324   double cellWidth  = (XMax() - XMin()) * 0.23;
     323  g->SelFontSz((YMax() - YMin())/30, mFAtt);
     324
     325  // La hauteur de la cellule
     326  PIGrCoord a, d;
     327  double cellHeight = 1.2 * (double)g->GetFontHeight(a,d);
     328
     329  // Les labels et leurs longueurs -> largeur de la cellule
     330  char label[32];
     331  sprintf(label,"N= %-6g", mHisto->NData());
     332  double cellWidth =  1.1 * (double)g->CalcStringWidth(label);
     333
     334  // Les limites du cadre
    325335  g->DrawLine(XMax() - cellWidth, YMax(),
    326336                       XMax() - cellWidth, YMax() - cellHeight);
    327337  g->DrawLine(XMax() - cellWidth, YMax() - cellHeight,
    328338                       XMax()            , YMax() - cellHeight);
    329   char label[50];
    330   sprintf(label, "N = %.6g", mHisto->NData());
    331   g->SelFontSz((YMax() - YMin())/30);
    332   g->DrawString(XMax() - cellWidth*0.9, YMax() - cellHeight*0.8, label);
    333 //  printf("H[%d,%d] Dynamique: [%g,%g] Frac [%g,%g]\n"
    334 //        ,mHisto->NBinX(),mHisto->NBinY(),HMin(),HMax(),FMin(),FMax());
     339
     340  // L'ecriture des labels
     341  g->DrawString(XMax() - cellWidth*0.95, YMax() - cellHeight*0.8,label);
     342  //  printf("H[%d,%d] Dynamique: [%g,%g] Frac [%g,%g]\n"
     343  //        ,mHisto->NBinX(),mHisto->NBinY(),HMin(),HMax(),FMin(),FMax());
    335344}
    336345
  • trunk/SophyaPI/PIext/pintuple.cc

    r686 r1644  
    207207  char label[64];
    208208  sprintf(label, "Nd= %d/ Ntot= %d", nok, mNT->NbLines());
    209   g->SelFontSz((YMax() - YMin())/25, mFAtt); 
     209  g->SelFontSz((YMax() - YMin())/30, mFAtt); 
    210210  PIGrCoord a,d;
    211211  double cH = (double)g->GetFontHeight(a,d);
    212   double cellHeight = cH * 1.3;
    213   double cellWidth =  (double)g->CalcStringWidth(label) * 1.1;
     212  double cellHeight = cH * 1.2;
     213  double cellWidth =   1.1 * (double)g->CalcStringWidth(label);
    214214  double xu, yu;
    215215  xu = g->DeltaUCX(XMax(), - cellWidth);
Note: See TracChangeset for help on using the changeset viewer.