Closed
Description
Describe the bug
See -> concise video showcase of the bug
Wrong bin is being highlighted, when using SetShowProjection()
with 2D histogram being with logarithmic axis.
Even when the mouse hovers over the far left bin, the bin with the value 1 is being highlighted.
Expected behavior
Only the bin should be highlighted where mouse coursor hovers, as it happens when using linear scale.
To Reproduce
void test() {
auto h = new TH2F("h", "title;x;y", 100, 0.001, 5, 100, 0., 5);
for(int i=0; i < 100000; i++){
double x = gRandom->Uniform(0., 5.);
double y = gRandom->Uniform(0., 5.);
h->Fill(x, y);
}
auto c = new TCanvas();
h->Draw("colz");
h->SetStats(0);
c->SetLogx();
// right-click on the histogram and SetShowProjectionY afterwards
}
$ root test.cpp
EDIT: In the newer versions of ROOT with the web-based TBrowser
to reproduce, run:
$ root --web=off test.cpp
Setup
- ROOT version: 6.26/06
- OS: Centos 7 (NOTE: Mac users are unaffected, as there seem to be no highlighting at all)
Additional context
- Initially submited on forum:
https://root-forum.cern.ch/t/setshowprojection-highlights-the-wrong-position-with-logarithmic-axis/53965/3