Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for TF1::SetRangerUser #12694

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Fix for TF1::SetRangerUser #12694

merged 2 commits into from
Apr 25, 2023

Conversation

couet
Copy link
Member

@couet couet commented Apr 21, 2023

Fix #12679

When drawiing 2 TF1 with different ranges the 2nd one (drawn iwth SAME) was not correct.

Reproducer:

{
   auto C = new TCanvas();
   auto f1 = new TF1("f1","1 + 0.5*cos(30*x)",2.5,4);
   f1->SetNpx(250);
   f1->GetXaxis()->SetRangeUser(3,3.5);
   f1->SetMarkerStyle(20);
   f1->SetMarkerColor(2);

   auto f2 = new TF1("f2","1 + 0.5*cos(30*x)",2.5,4);
   f2->SetNpx(250);
   f2->GetXaxis()->SetRangeUser(3.3,3.4);
   f2->SetLineColor(4);
   f2->SetLineWidth(4);

   f1->Draw(" p");
   f2->Draw("same  L");
   C->SetGridx();
}

@couet couet requested a review from lmoneta as a code owner April 21, 2023 16:03
@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@couet couet self-assigned this Apr 21, 2023
@couet couet mentioned this pull request Apr 21, 2023
@phsft-bot
Copy link
Collaborator

Build failed on ROOT-debian10-i386/soversion.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on mac12/noimt.
Running on macphsft17.dyndns.cern.ch:/Users/sftnight/build/jenkins/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu18.04/nortcxxmod.
Running on sft-ubuntu-1804-2.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/python3.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@github-actions
Copy link

github-actions bot commented Apr 21, 2023

Test Results

         5 files           5 suites   1d 4h 32m 21s ⏱️
  2 427 tests   2 421 ✔️ 0 💤   6
11 976 runs  11 955 ✔️ 0 💤 21

For more details on these failures, see this check.

Results for commit a5f93af.

♻️ This comment has been updated with latest results.

@phsft-bot
Copy link
Collaborator

Build failed on mac11/cxx14.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

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

LGTM!
Thank you Olivier for the fix. I understand what was causing this problem.
Do you know why these two lines were there ? Maybe worth looking at the history if in case those lines were added to fix a particular issue

if (xmin < pmin) xmin = pmin;
 if (xmax > pmax) xmax = pmax;

In principle if you want to make the histogram in a smaller range, one should also scale the number of bins of the histograms to be consistent.

@couet
Copy link
Member Author

couet commented Apr 25, 2023

Hi Lorenzo. I did look at the history and it seems to have been always there. There is no test or code illustrating why they have been ut there. I will do more check and merge. Thanks.

@phsft-bot
Copy link
Collaborator

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu18.04/nortcxxmod.
Running on sft-ubuntu-1804-2.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/python3.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@couet couet merged commit a5754ae into root-project:master Apr 25, 2023
enirolf pushed a commit to enirolf/root that referenced this pull request May 26, 2023
* Fix for TF1::SetRangerUser

* stressGraphics ref files adjustment
@couet couet deleted the tf1-rangeuser branch September 28, 2023 09:15
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.

Draw two TF1
3 participants