Changeset 1644 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Aug 23, 2001, 7:51:29 PM (24 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto.cc
r1090 r1644 137 137 // if (mLAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine); 138 138 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 141 142 PIGrCoord a, d; 142 143 double cH = (double)g->GetFontHeight(a,d); 143 144 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 148 156 double xu, yu; 157 // Les limites du cadre 149 158 xu = g->DeltaUCX(XMax(), - cellWidth); 150 159 yu = g->DeltaUCY(YMax(), - cellHeight); 151 160 g->DrawLine(xu, YMax(), xu, yu); 152 161 g->DrawLine(xu, yu, XMax(), yu); 162 163 // L'ecriture des labels 153 164 xu = g->DeltaUCX(XMax(), - cellWidth*0.95); 154 165 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); 157 167 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); 160 169 yu = g->DeltaUCY(YMax(), - cH*3.45); 161 g->DrawString(xu, yu, label );170 g->DrawString(xu, yu, label3); 162 171 163 172 } -
trunk/SophyaPI/PIext/pihisto2d.cc
r1297 r1644 319 319 //-- 320 320 { 321 // Une boite dans le coin superieur droit321 if (!mHisto) return; 322 322 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 325 335 g->DrawLine(XMax() - cellWidth, YMax(), 326 336 XMax() - cellWidth, YMax() - cellHeight); 327 337 g->DrawLine(XMax() - cellWidth, YMax() - cellHeight, 328 338 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()); 335 344 } 336 345 -
trunk/SophyaPI/PIext/pintuple.cc
r686 r1644 207 207 char label[64]; 208 208 sprintf(label, "Nd= %d/ Ntot= %d", nok, mNT->NbLines()); 209 g->SelFontSz((YMax() - YMin())/ 25, mFAtt);209 g->SelFontSz((YMax() - YMin())/30, mFAtt); 210 210 PIGrCoord a,d; 211 211 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); 214 214 double xu, yu; 215 215 xu = g->DeltaUCX(XMax(), - cellWidth);
Note:
See TracChangeset
for help on using the changeset viewer.