Skip to content

Conversation

@couet
Copy link
Member

@couet couet commented Mar 11, 2025

As suggested here this PR differentiate empty bins and bins with zero content when using the drawing option COL. The following little taste shows how it is working.

void col1(){
  auto h = new TH2D ("h2","h2",10,0.5,10.5,10,0.5,10.5);
  h->Fill(1.,1.,1.);
  h->Fill(2.,2.,2.);
  h->Fill(3.,3.,3.);
  h->Fill(4.,4.,4.);
  h->Fill(5.,5.,5.);
  h->Fill(6.,6.,6.);    
  h->Fill(6.,6.,-6.);
  printf("Error for bin #%d = %g\n",6,h->GetBinError(6,6));
  h->Fill(7.,7.,-7.);
  printf("Error for bin #%d = %g\n",8,h->GetBinError(8,8));
  h->Draw("COL1 Z");
}

@couet couet requested a review from linev March 11, 2025 10:15
@couet couet self-assigned this Mar 11, 2025
@couet couet requested a review from lmoneta as a code owner March 11, 2025 10:15
Copy link
Member

@linev linev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for me.

I will adjust code in JSROOT as well.
I do not see side effects on my test cases

@github-actions
Copy link

github-actions bot commented Mar 11, 2025

Test Results

    18 files      18 suites   4d 10h 40m 9s ⏱️
 2 725 tests  2 724 ✅ 0 💤 1 ❌
47 351 runs  47 350 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit b14463e.

♻️ This comment has been updated with latest results.

@couet couet closed this Mar 12, 2025
@couet couet deleted the COL_Fix branch March 12, 2025 08:41
@couet couet restored the COL_Fix branch March 12, 2025 08:44
@couet couet reopened this Mar 12, 2025
linev added a commit to linev/root that referenced this pull request Mar 13, 2025
1. Implement 'arr_colz' draw option for `TH2`
2. Only 'col7' draw option uses bar offset and width for color `TH2` drawing
3. Interactive zooming and context menu on 'chord' `TH2` drawing
4. Implement 'box1' for `TH3` with negative bins
5. Test fSumw2 when detect empty TH2 bin, sync with root-project#17948
6. Upgrade three.js r168 -> r174
7. Internals - use private members and methods
8. Internals - use `WeakRef` class for cross-referencing of painters
9. Internals - use negative indexes in arrays and Strings
10. Internals - use stricter eslint checks
11. Fix - drawing `TPaveText` with zero text size
12. Fix - hidden canvas in Jupyter Lab, https://root-forum.cern.ch/t/63097/
13. Fix - latex super-script without leading symbol, https://root-forum.cern.ch/t/63114/
14. Fix - correctly read std::pair<> without dictionary, https://root-forum.cern.ch/t/63114/
15. Fix - TGaxis custom labels scaling
@couet couet merged commit fb2ef26 into master Mar 13, 2025
8 of 22 checks passed
linev added a commit that referenced this pull request Mar 13, 2025
1. Implement 'arr_colz' draw option for `TH2`
2. Only 'col7' draw option uses bar offset and width for color `TH2` drawing
3. Interactive zooming and context menu on 'chord' `TH2` drawing
4. Implement 'box1' for `TH3` with negative bins
5. Test fSumw2 when detect empty TH2 bin, sync with #17948
6. Upgrade three.js r168 -> r174
7. Internals - use private members and methods
8. Internals - use `WeakRef` class for cross-referencing of painters
9. Internals - use negative indexes in arrays and Strings
10. Internals - use stricter eslint checks
11. Fix - drawing `TPaveText` with zero text size
12. Fix - hidden canvas in Jupyter Lab, https://root-forum.cern.ch/t/63097/
13. Fix - latex super-script without leading symbol, https://root-forum.cern.ch/t/63114/
14. Fix - correctly read std::pair<> without dictionary, https://root-forum.cern.ch/t/63114/
15. Fix - TGaxis custom labels scaling
@couet couet deleted the COL_Fix branch March 19, 2025 12:25
linev added a commit to linev/root that referenced this pull request Apr 25, 2025
1. New draw options:
   - 'pol' and 'arr_colz' draw option for `TH2`
   - 'col7' uses bar offset and width for `TH2`
   - 'cont5' for `TGraph2D` using Delaunay algorithm
   - 'chord' drawing of `TH2` implements zooming
   - 'box1' for `TH3` with negative bins
   - 'same' option for first histogram on pad, draw without creating `TFrame`
   - 'rangleNN' for `TGraphPolargram`, also support fAxisAngle member
   - 'N' and 'O' for `TGraphPolargram` for angle coordinate systems
   - 'arc' for `TPave` and derived classes
   - 'allbins' for histograms to display underflow/overflow bins
   - Poisson errors for `TH1`/`TH2`, https://root-forum.cern.ch/t/62335/
   - test fSumw2 when detect empty `TH2` bin, sync with root-project#17948
2. New supported classes:
   - `TF12` - projection of `TF2`
   - `TLink` and `TButton`, used in `TInspectCanvas`
3. New partameters in `TTree::Draw`:
   - '>>elist' to request entries matching cut conditions
   - 'elist' to specify entries for processing
   - 'nmatch' to process exactly the specified number of entries, break processing afterwards
   - 'staged' algorithm to first select entries and then process only these entries
4. New settings parameters:
   - `settings.FilesTimeout` global timeout for file reading operations
   - `settings.FilesRemap` fallback address for http server, used for `root.cern`
   - `settings.TreeReadBunchSize` bunch read size for `TTree` processing
   - `settings.UserSelect` to set 'user-select: none' style in drawings to exclude text selection
5. Context menus:
   - all `TPave`-derived classes
   - in 'chord' drawings of `TH2`
   - editing histogram and graph title
6. Fixes:
   - match histogram title drawing with native ROOT implementation
   - float to string conversion when 'g' is specified
   - handle `TPave` NDC position also when fInit is not set
   - properly handle image sizes in svg2pdf
   - drawing `TPaveText` with zero text size
   - correct axis range in `TScatter` drawing
   - use draw option also for graph drawing in `TTree::Draw`
7. Internals:
   - upgrade three.js r168 -> r174
   - use private members and methods
   - use `WeakRef` class for cross-referencing of painters
   - use negative indexes in arrays and Strings
   - remove support of qt5 webengine, only qt6web can be used
@linev linev mentioned this pull request Apr 25, 2025
2 tasks
linev added a commit that referenced this pull request Apr 25, 2025
1. New draw options:
   - 'pol' and 'arr_colz' draw option for `TH2`
   - 'col7' uses bar offset and width for `TH2`
   - 'cont5' for `TGraph2D` using Delaunay algorithm
   - 'chord' drawing of `TH2` implements zooming
   - 'box1' for `TH3` with negative bins
   - 'same' option for first histogram on pad, draw without creating `TFrame`
   - 'rangleNN' for `TGraphPolargram`, also support fAxisAngle member
   - 'N' and 'O' for `TGraphPolargram` for angle coordinate systems
   - 'arc' for `TPave` and derived classes
   - 'allbins' for histograms to display underflow/overflow bins
   - Poisson errors for `TH1`/`TH2`, https://root-forum.cern.ch/t/62335/
   - test fSumw2 when detect empty `TH2` bin, sync with #17948
2. New supported classes:
   - `TF12` - projection of `TF2`
   - `TLink` and `TButton`, used in `TInspectCanvas`
3. New partameters in `TTree::Draw`:
   - '>>elist' to request entries matching cut conditions
   - 'elist' to specify entries for processing
   - 'nmatch' to process exactly the specified number of entries, break processing afterwards
   - 'staged' algorithm to first select entries and then process only these entries
4. New settings parameters:
   - `settings.FilesTimeout` global timeout for file reading operations
   - `settings.FilesRemap` fallback address for http server, used for `root.cern`
   - `settings.TreeReadBunchSize` bunch read size for `TTree` processing
   - `settings.UserSelect` to set 'user-select: none' style in drawings to exclude text selection
5. Context menus:
   - all `TPave`-derived classes
   - in 'chord' drawings of `TH2`
   - editing histogram and graph title
6. Fixes:
   - match histogram title drawing with native ROOT implementation
   - float to string conversion when 'g' is specified
   - handle `TPave` NDC position also when fInit is not set
   - properly handle image sizes in svg2pdf
   - drawing `TPaveText` with zero text size
   - correct axis range in `TScatter` drawing
   - use draw option also for graph drawing in `TTree::Draw`
7. Internals:
   - upgrade three.js r168 -> r174
   - use private members and methods
   - use `WeakRef` class for cross-referencing of painters
   - use negative indexes in arrays and Strings
   - remove support of qt5 webengine, only qt6web can be used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants