Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10673

TPad::logX broken for histograms with Sumw2 errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.20/02
    • Fix Version/s: 6.20/06
    • Component/s: Graphics
    • Labels:
      None
    • Environment:

      any

    • Development:

      Description

      Dear root experts,

      it seems like the logX functionality is no longer working for histograms with errors.

      With ROOT version 6.18/04 the minimal example code below works as expected, but in version 6.20/02 the histogram content is not displayed properly.

      However, the logX still works for histograms without errors (in case no Sumw2 is called or errors are set to zero manually).

      Thanks and cheers,

        Mario

       

      void logxtest()
      {
        const int nBins = 100;
        TH1F* hist = new TH1F("hist", "", nBins, 0.5, nBins+0.5);
        hist->Sumw2(); // without Sumw2 it works fine
        for(int i = 1; i <= nBins; i++) hist->Fill(i);	
        TCanvas* canv = new TCanvas("canv", "");
        canv->Divide(1, 2);
        canv->cd(1);
        hist->Draw();
        gPad->SetLogx();
        canv->cd(2);
        hist->Draw();
      }
      

       

       

        Attachments

        1. canv.png
          canv.png
          14 kB
        2. canv.png
          canv.png
          13 kB

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              mkruger Mario Kruger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: