Changeset 1644 in Sophya for trunk/SophyaPI/PIext/pihisto2d.cc


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.