root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.61k stars 1.25k forks source link

[ROOT-5125] Autozoom functionality for TH1/TH2/TH3 or TAxis classes #14538

Open vepadulano opened 6 months ago

vepadulano commented 6 months ago

Feature description

From https://its.cern.ch/jira/browse/ROOT-5125

I missing feature of automatic zoom in the histogram to the range where histogram is filled. It could be very useful for 1-D histograms with single sharp peak - in this case user need many selections on axis before necessary range will be shown. This could be menu function of TH1/TH2/TH3 class or TAxis class. If interesting, I could provide implementation for this.

Alternatives considered

No response

Additional context

No response

couet commented 6 months ago

@linev in that old Jira report you said you have some patch for this "Crop" functionality. Do you still have it ? I could not find a link to it from the report.

linev commented 6 months ago

There is no PR for it.

But I implement code in our go4 framework long time ago.

If we want to have such functionality - we can move this code into ROOT. It can be methods for TH1/TH2 classes to automatically zoom into non-empty bins.

dpiparo commented 1 month ago

I was rethinking to this issue. How big is the problem? Is it worth introducing heuristics to zoom on very sharp peaks when it can be done with SetRangeUser or with 2-3 mouse movements?

linev commented 3 weeks ago

@dpiparo

Idea to have such auto-zoom functionality in interactive canvas.

It is already implemented in JSROOT and also available in web-based canvas. Can be see by pressing Ctrl + *. See on screenshot: autozoom

From this point of view issue is resolved - once web-canvas will be switched as default.