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 polar limits #5397

Merged
merged 2 commits into from
Aug 19, 2022
Merged

Fix polar limits #5397

merged 2 commits into from
Aug 19, 2022

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Aug 18, 2022

Fixes #5396

image

@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2022

Codecov Report

Merging #5397 (0400851) into master (8b2ee78) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5397      +/-   ##
==========================================
- Coverage   88.07%   88.07%   -0.01%     
==========================================
  Files         301      301              
  Lines       61969    61991      +22     
==========================================
+ Hits        54579    54596      +17     
- Misses       7390     7395       +5     
Impacted Files Coverage Δ
holoviews/plotting/mpl/element.py 90.08% <100.00%> (+0.05%) ⬆️
...iews/tests/plotting/matplotlib/test_elementplot.py 98.42% <100.00%> (+0.07%) ⬆️
holoviews/util/transform.py 85.25% <0.00%> (-0.75%) ⬇️
holoviews/core/data/pandas.py 93.30% <0.00%> (-0.10%) ⬇️
holoviews/tests/core/test_utils.py 99.20% <0.00%> (+<0.01%) ⬆️
holoviews/core/util.py 86.06% <0.00%> (+0.03%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hoxbro hoxbro requested a review from jlstevens August 19, 2022 08:52
@jlstevens
Copy link
Contributor

Thanks for the quick fix!

The diff looks fine to me and the additional unit test gives me confidence. Could you explain why this bug manifested itself for the scatter element but not for a curve? And why did it seem to work up to a certain angle? I'm guessing the polar axis wasn't being defined for a full circle.

Why would the polar axes be ok for one element and not another?

Once my curiosity is satisfied, I am happy to merge. :-)

@hoxbro
Copy link
Member Author

hoxbro commented Aug 19, 2022

I don't think any of the plots worked there was always a slice missing.

extents = self.get_extents(view, ranges)

Returns the following for the three examples in #5396:

a = [-0.53, -0.2, 5.83, 2.2]
b = [-0.52, -0.2, 5.72 2.2]
c = [0.0, -0.2, 5.3, 2.2]

So the reason why the Curve plot is fine is that the extents is not padded.

Then somewhere, a round-trip of going from coordinates back to radians is done, which can be faked with something like this np.arcsin(np.sin(x))) which for a gives l=-0.53 and r=-0.45, which gives the small slice. For b we get l=-0.52 and r=-0.56, which gives the almost full circle.

I hope this satisfies your curiosity.

@jlstevens
Copy link
Contributor

I hope this satisfies your curiosity.

Yes thanks. merging!

@jlstevens jlstevens merged commit 15eaae8 into master Aug 19, 2022
@jlstevens jlstevens deleted the fix_polar_limits branch August 19, 2022 10:10
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scatter polar projection main plot disappears when theta above 5.3 radians
3 participants