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

TAxis: updating BinLabels does not update fLabels HashList

    Details

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

      All

      Description

      Description:
      TAxis a has bin labels. Labels are modified through a.SetBinLabel(i,"label&quot
      After that, a.FindBin("label&quot always return 0
      Cause is that fLabels is not completely updated.

      Example:
      h=TH1F("h","h",1,0,1)
      a=h.GetXaxis()
      a.SetBinLabel(1,"one&quot
      a.FindBin("one&quot // returns 1, OK
      a.SetBinLabel(1,"un&quot
      a.FindBin("un&quot // returns 0, WRONG
      // however:
      a.GetBinLabel(1) // returns 'un', OK

      Workaround:
      a.GetLabels().Rehash(a.GetNbins()+2) // rebuilds the hashtable
      a.FindBin("un&quot // returns 1, OK

      Expected behaviour:a.FindBin("un&quot
      The workaround above should not have to be used.

      Best regards,
      Nicolas

        Attachments

          Activity

            People

            • Assignee:
              moneta Lorenzo Moneta
              Reporter:
              nmorange Nicolas Morange
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: