Skip to content

SetShowProjection highlights wrong bins on 2d histogram with logarithmic axis #12497

Closed
@dudarboh

Description

@dudarboh

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

  1. ROOT version: 6.26/06
  2. OS: Centos 7 (NOTE: Mac users are unaffected, as there seem to be no highlighting at all)

Additional context

  1. Initially submited on forum:
    https://root-forum.cern.ch/t/setshowprojection-highlights-the-wrong-position-with-logarithmic-axis/53965/3

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions