- Timestamp:
- 06/27/03 15:13:10 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2244 r2245 23 23 * mhist/MHPixVsTime.[h,cc]: 24 24 - added 25 26 * mhist/MHCamera.cc: 27 - changed output of labels for color axis 25 28 26 29 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2236 r2245 881 881 // Change the text on the legend according to the range of the Display 882 882 // 883 void MHCamera::UpdateLegend(Float_t min phe, Float_t maxphe, Bool_t islog)883 void MHCamera::UpdateLegend(Float_t min, Float_t max, Bool_t islog) 884 884 { 885 885 const Float_t range = fGeomCam->GetMaxRadius(); … … 900 900 #endif 901 901 902 const Float_t step = (islog && min>0 ? log10(max/min) : max-min) / kItemsLegend; 903 const Int_t firsts = step*3 < 1e-8 ? 8 : (Int_t)floor(log10(step*3)); 904 const TString opt = Form("%%.%if", firsts>0 ? 0 : abs(firsts)); 905 902 906 for (Int_t i=0; i<kItemsLegend+1; i+=3) 903 907 { 904 const Float_t pos = (Float_t)i/kItemsLegend;905 906 908 Float_t val; 907 if (islog && min phe>0)908 val = pow(10, log10(maxphe/minphe)*pos) * minphe;909 if (islog && min>0) 910 val = pow(10, step*i) * min; 909 911 else 910 val = minphe + pos * (maxphe-minphe); 911 912 newtxt.PaintText(range+1.5*w, H*(i*h-1)-offset, Form(val<1e6?"%5.1f":"%5.1e", val)); 912 val = min + step*i; 913 914 //const bool dispexp = max-min>1.5 && fabs(val)>0.1 && fabs(val)<1e6; 915 newtxt.PaintText(range+1.5*w, H*(i*h-1)-offset, Form(opt, val)); 913 916 } 914 917
Note:
See TracChangeset
for help on using the changeset viewer.