Changeset 2383 in Sophya for trunk/SophyaPI/PIext/pihisto.cc
- Timestamp:
- May 16, 2003, 5:15:55 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto.cc
r2232 r2383 39 39 SetStats(); 40 40 SetError(); 41 SetStatPosOffset(); 41 42 SetName("HistoDrw"); 42 43 } … … 173 174 else if(opts=="noerr") SetError(-1); 174 175 else if(opts=="autoerr") SetError(0); 176 else if(opts.substr(0,11) == "statposoff=") { 177 float xo=0., yo=0.; 178 sscanf(opts.substr(11).c_str(),"%g,%g",&xo, &yo); 179 SetStatPosOffset(xo, yo); 180 } 175 181 else { 176 182 ndec--; … … 191 197 PIDrawer::GetOptionsHelpInfo(info); 192 198 info += " ---- PIHisto options help info : \n" ; 193 info += " -sta,stat,stats: activate statistic display\n";199 info += " sta,stat,stats: activate statistic display\n"; 194 200 info += " nsta,nstat,nostat,nostats: deactivate statistic display\n"; 195 info += " -err / nerr : draw, do not draw error bars\n";201 info += " err / nerr : draw, do not draw error bars\n"; 196 202 info += " autoerr : draw error bars if Marker drawing requested OR Profile histo\n"; 203 info += " statposoff=OffsetX,OffsetY : Position offset for Stats drawing \n"; 204 info += " as a fraction of total size \n"; 197 205 return; 198 206 } … … 221 229 double cellWidth = 1.1 * (double)g->CalcStringWidth(label); 222 230 231 double ofpx = spoX*(XMax()-XMin()); 232 double ofpy = spoY*(YMax()-YMin()); 233 223 234 double xu, yu, cw; 224 235 // Les limites du cadre 225 236 xu = g->DeltaUCX(XMax(), -cellWidth); 226 237 yu = g->DeltaUCY(YMax(), -cellHeight); 227 g->DrawLine(xu,YMax(),xu,yu); 228 g->DrawLine(xu,yu,XMax(),yu); 238 double recw = XMax()-xu; 239 double rech = YMax()-yu; 240 xu += ofpx; yu += ofpy; 241 g->DrawBox(xu, yu, recw, rech); 229 242 230 243 // L'ecriture des labels (attention aux inversions possibles des axes!) … … 234 247 cw = (g->isAxeYDirUpDown()) ? -0.15*cH : -1.15*cH; 235 248 yu = g->DeltaUCY(YMax(),cw); 249 xu += ofpx; yu += ofpy; 236 250 g->DrawString(xu, yu,label1); 237 238 yu = g->DeltaUCY(YMax(),cw);239 240 241 yu = g->DeltaUCY(YMax(),cw);242 251 cw += -1.15*cH; 252 yu = g->DeltaUCY(YMax(),cw); yu += ofpy; 253 g->DrawString(xu, yu,label2); 254 cw += -1.15*cH; 255 yu = g->DeltaUCY(YMax(),cw); yu += ofpy; 256 g->DrawString(xu, yu,label3); 243 257 244 258 }
Note:
See TracChangeset
for help on using the changeset viewer.