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

TAxis::GetTicks and TAxis::SetTicks are inconsistent. Significantly so. #14256

Closed
1 task
aharel opened this issue Dec 17, 2023 · 3 comments · Fixed by #14257
Closed
1 task

TAxis::GetTicks and TAxis::SetTicks are inconsistent. Significantly so. #14256

aharel opened this issue Dec 17, 2023 · 3 comments · Fixed by #14257

Comments

@aharel
Copy link

aharel commented Dec 17, 2023

Check duplicate issues.

  • Checked for duplicates

Description

When creating a modified version of a histogram/graph it's useful to have the axis of the new variation emulate those of the original. Something like target.SetXXX( original.GetXXX()) should do the trick. And it does for almost everything. The exception are the Ticks. Where if idol has bits 9 & 10 (kTickPlus and kTickMinus) both false, GetTicks returns '+' which SetTicks encodes as bit 9 on and bit 10 off. This not only messes up the display of the ticks, but also the location of the tick labels and the axis' main title.
I'm working around that by manually called SetBit, so it's no longer a problem for me. But it just seems like an API bug.

Reproducer

TAxis idol, target;
target.SetTicks( idol.GetTicks() )
cout<<idol.TestBits( 1<<9 )<<" --> "<<target.TestBits( 1<<9 )<<endl;

ROOT version

6.26/06
Built for linuxx8664gcc on Jul 28 2022, 18:08:51
From tags/v6-26-06@v6-26-06                                    
With c++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0       

Installation method

Built from source

Operating system

Linux

Additional context

No response

@ferdymercury
Copy link
Collaborator

I proposed a fix, see link above.

@aharel
Copy link
Author

aharel commented Dec 18, 2023

Code looks good.
Not so sure about the comment.
When you create a histogram and draw it, the axes are created with both bits off and the ticks are drawn inside.

@ferdymercury
Copy link
Collaborator

Thanks, I just fixed the explanation.

@guitargeek guitargeek added this to Issues in Fixed in 6.30.04 via automation Dec 18, 2023
@guitargeek guitargeek added this to Issues in Fixed in 6.32.00 via automation Dec 18, 2023
guitargeek pushed a commit to guitargeek/root that referenced this issue Dec 18, 2023
maksgraczyk pushed a commit to maksgraczyk/root that referenced this issue Jan 12, 2024
vgvassilev pushed a commit to vgvassilev/root that referenced this issue Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants