Changeset 544 in Sophya for trunk/SophyaPI/PIext/pihisto.cc
- Timestamp:
- Nov 3, 1999, 7:18:23 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto.cc
r295 r544 1 // Classe traceur d histogramme 96-99 2 // CEA-DAPNIA LAL-IN2P3/CNRS 3 1 4 #include <stdio.h> 2 5 #include <typeinfo> … … 5 8 #include "hisprof.h" 6 9 10 //++ 11 // Class PIHisto 12 // Lib PIext 13 // include pihisto.h 14 // 15 // Classe traceur d'objet histogramme (classe *Histo*) 16 //-- 17 //++ 18 // Links Parents 19 // PIDrawer 20 //-- 21 //++ 22 // Titre Constructeur, méthodes 23 //-- 24 //++ 25 // PIHisto(Histo* histo, bool ad=false) 26 // Constructeur. Si "ad == true", l'objet "histo" est détruit par 27 // le destructeur de l'objet "PIHisto" 28 // Note : "histo" doit être créé par new 29 // 30 // void SetStats(bool fg=true) 31 // Active/ désactive l'indication des statistiques d'histogramme 32 //-- 33 34 7 35 PIHisto::PIHisto(Histo* histo, bool ad) 8 36 : PIDrawer(), mHisto(histo) 9 37 { 10 38 mAdDO = ad; // Flag pour suppression automatique de mHisto 39 SetStats(true); 11 40 } 12 41 … … 96 125 } 97 126 // A faire a la fin - DrawStats change l'attribut de ligne 98 DrawStats(g);127 if (stats) DrawStats(g); 99 128 } 100 129 … … 105 134 // if (mLAtt == PI_NotDefLineAtt) g->SelLine(PI_ThinLine); 106 135 g->SelLine(PI_ThinLine); 107 double cellHeight = (YMax() - YMin()) * 0.05; 108 double cellWidth = (XMax() - XMin()) * 0.23; 136 g->SelFontSz((YMax() - YMin())/25, mFAtt); 137 // double cellHeight = (YMax() - YMin()) * 0.05; 138 PIGrCoord a, d; 139 double cH = (double)g->GetFontHeight(a,d); 140 double cellHeight = cH * 3.8; 141 // double cellWidth = (XMax() - XMin()) * 0.23; 142 char label[50]; 143 sprintf(label, "N= %.8g ", mHisto->NData()); 144 label[11] ='\0'; 145 double cellWidth = (double)g->CalcStringWidth(label) * 1.1; 109 146 g->DrawLine(XMax() - cellWidth, YMax(), 110 147 XMax() - cellWidth, YMax() - cellHeight); 111 148 g->DrawLine(XMax() - cellWidth, YMax() - cellHeight, 112 149 XMax() , YMax() - cellHeight); 113 char label[50]; 114 sprintf(label, "N = %.6g", mHisto->NData()); 115 g->SelFontSz((YMax() - YMin())/30); 116 g->DrawString(XMax() - cellWidth*0.9, YMax() - cellHeight*0.8, label); 150 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*1.2, label); 151 sprintf(label, "m= %.8g", mHisto->Mean()); 152 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*2.4, label); 153 sprintf(label, "s= %.8g", mHisto->Sigma()); 154 g->DrawString(XMax() - cellWidth*0.95, YMax() - cH*3.6, label); 117 155 118 156 }
Note:
See TracChangeset
for help on using the changeset viewer.