root icon indicating copy to clipboard operation
root copied to clipboard

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

Open vepadulano opened this issue 1 year ago • 2 comments

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

vepadulano avatar Feb 04 '24 17:02 vepadulano

@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.

couet avatar Feb 14 '24 15:02 couet

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.

linev avatar Feb 14 '24 15:02 linev

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?

dpiparo avatar Jul 20 '24 18:07 dpiparo

@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.

linev avatar Jul 29 '24 06:07 linev