Changeset 1644 in Sophya for trunk/SophyaPI/PIext/pihisto.cc
- Timestamp:
- Aug 23, 2001, 7:51:29 PM (24 years ago)
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.