Changeset 2245 for trunk


Ignore:
Timestamp:
06/27/03 15:13:10 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2244 r2245  
    2323   * mhist/MHPixVsTime.[h,cc]:
    2424     - added
     25
     26   * mhist/MHCamera.cc:
     27     - changed output of labels for color axis
    2528
    2629
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2236 r2245  
    881881//  Change the text on the legend according to the range of the Display
    882882//
    883 void MHCamera::UpdateLegend(Float_t minphe, Float_t maxphe, Bool_t islog)
     883void MHCamera::UpdateLegend(Float_t min, Float_t max, Bool_t islog)
    884884{
    885885    const Float_t range = fGeomCam->GetMaxRadius();
     
    900900#endif
    901901
     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
    902906    for (Int_t i=0; i<kItemsLegend+1; i+=3)
    903907    {
    904         const Float_t pos = (Float_t)i/kItemsLegend;
    905 
    906908        Float_t val;
    907         if (islog && minphe>0)
    908             val = pow(10, log10(maxphe/minphe)*pos) * minphe;
     909        if (islog && min>0)
     910            val = pow(10, step*i) * min;
    909911        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));
    913916    }
    914917
Note: See TracChangeset for help on using the changeset viewer.