Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Small improvements to aitoff projection. #19076

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

Merged
merged 1 commit into from
Dec 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/matplotlib/projections/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,7 @@ def transform_non_affine(self, ll):
cos_latitude = np.cos(latitude)

alpha = np.arccos(cos_latitude * np.cos(half_long))
# Avoid divide-by-zero errors using same method as NumPy.
alpha[alpha == 0.0] = 1e-20
# We want unnormalized sinc. numpy.sinc gives us normalized
sinc_alpha = np.sin(alpha) / alpha
sinc_alpha = np.sinc(alpha / np.pi) # np.sinc is sin(pi*x)/(pi*x).

x = (cos_latitude * np.sin(half_long)) / sinc_alpha
y = np.sin(latitude) / sinc_alpha
Expand All @@ -282,7 +279,7 @@ class InvertedAitoffTransform(_GeoTransform):
def transform_non_affine(self, xy):
# docstring inherited
# MGDTODO: Math is hard ;(
return xy
return np.full_like(xy, np.nan)

def inverted(self):
# docstring inherited
Expand Down