[ROOT-5025] TAxis: updating BinLabels does not update fLabels HashList Created: 24/Mar/13  Updated: 15/May/19  Resolved: 04/Dec/13

Status: Closed
Project: ROOT
Component/s: Graphics
Affects Version/s: 5.34/00
Fix Version/s: None

Type: Bug Priority: High
Reporter: Nicolas Morange Assignee: Lorenzo Moneta
Resolution: Fixed Votes: 0
Labels: None
Environment:

All


External issue ID: bugs100978
External issue URL: https://savannah.cern.ch/bugs/?100978
Development:

 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



 Comments   
Comment by Lorenzo Moneta [ 04/Dec/13 ]

This is now fixed in 5.34 patches and trunk.
The Rehash function is called now internally when SetBinLabel is called

Lorenzo

Generated at Sun Sep 22 01:30:12 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.