diff --git a/CHANGELOG b/CHANGELOG index e8cd1fc1b850..4a1b1e45079d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2736,7 +2736,7 @@ 2007-02-12 Moved data files into lib/matplotlib so that setuptools' develop mode works. Re-organized the mpl-data layout so that this source structure is maintained in the - installation. (I.e. the 'fonts' and 'images' + installation. (i.e., the 'fonts' and 'images' sub-directories are maintained in site-packages.) Suggest removing site-packages/matplotlib/mpl-data and ~/.matplotlib/ttffont.cache before installing - ADS diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 5449ce61827a..be878d0a7dc7 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -1339,7 +1339,7 @@ Changes for 0.90.1 Moved data files into lib/matplotlib so that setuptools' develop mode works. Re-organized the mpl-data layout so that this source - structure is maintained in the installation. (I.e. the 'fonts' and + structure is maintained in the installation. (i.e., the 'fonts' and 'images' sub-directories are maintained in site-packages.). Suggest removing site-packages/matplotlib/mpl-data and ~/.matplotlib/ttffont.cache before installing diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index e9fe99d2c4a4..0d5eee9c6160 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -201,7 +201,7 @@ illustration) just passes them on to the self.update(kwargs) ``update`` does the work looking for methods named like -``set_property`` if ``property`` is a keyword argument. I.e., no one +``set_property`` if ``property`` is a keyword argument. i.e., no one looks at the keywords, they just get passed through the API to the artist constructor which looks for suitably named methods and calls them with the value. diff --git a/doc/devel/license.rst b/doc/devel/license.rst index 1354f7b82117..6afe33afc559 100644 --- a/doc/devel/license.rst +++ b/doc/devel/license.rst @@ -28,7 +28,7 @@ most widely used license is the GPL, which in addition to granting you full rights to the source code including redistribution, carries with it an extra obligation. If you use GPL code in your own code, or link with it, your product must be released under a GPL compatible -license. I.e., you are required to give the source code to other +license. i.e., you are required to give the source code to other people and give them the right to redistribute it as well. Many of the most famous and widely used open source projects are released under the GPL, including linux, gcc, emacs and sage. diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 76be9e7e347b..19bbdc3291c3 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1423,7 +1423,7 @@ def cohere_pairs(X, ij, NFFT=256, Fs=2, detrend=detrend_none, where: - *Cxy*: dictionary of (*i*, *j*) tuples -> coherence vector for - that pair. I.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``. + that pair. i.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``. Number of dictionary keys is ``len(ij)``. - *Phase*: dictionary of phases of the cross spectral density at diff --git a/lib/matplotlib/tests/test_path.py b/lib/matplotlib/tests/test_path.py index 4590dfb51aa0..cea71c37d66f 100644 --- a/lib/matplotlib/tests/test_path.py +++ b/lib/matplotlib/tests/test_path.py @@ -61,6 +61,15 @@ def test_path_clipping(): xy, facecolor='none', edgecolor='red', closed=True)) +def test_point_in_path_nan(): + box = np.array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]) + p = Path(box) + test = np.array([[np.nan, 0.5]]) + contains = p.contains_points(test) + assert len(contains) == 1 + assert not contains[0] + + if __name__ == '__main__': import nose nose.runmodule(argv=['-s', '--with-doctest'], exit=False) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index d75c23853f7b..cc760a1f2a7f 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -1036,7 +1036,7 @@ class TextWithDash(Text): *dashrotation* specifies the rotation of the dash, and should generally stay *None*. In this case :meth:`~matplotlib.text.TextWithDash.get_dashrotation` returns - :meth:`~matplotlib.text.Text.get_rotation`. (I.e., the dash takes + :meth:`~matplotlib.text.Text.get_rotation`. (i.e., the dash takes its rotation from the text's rotation). Because the text center is projected onto the dash, major deviations in the rotation cause what may be considered visually unappealing results. diff --git a/src/_path.h b/src/_path.h index 4e7ab8549c9d..bbb95624e300 100644 --- a/src/_path.h +++ b/src/_path.h @@ -102,10 +102,12 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins for (i = 0; i < n; ++i) { ty = points[i][1]; - // get test bit for above/below X axis - yflag0[i] = (vty0 >= ty); + if (MPL_isfinite64(ty)) { + // get test bit for above/below X axis + yflag0[i] = (vty0 >= ty); - subpath_flag[i] = 0; + subpath_flag[i] = 0; + } } do { @@ -124,6 +126,10 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins tx = points[i][0]; ty = points[i][1]; + if (MPL_notisfinite64(tx) || MPL_notisfinite64(ty)) { + continue; + } + yflag1 = (vty1 >= ty); // Check if endpoints straddle (are on opposite sides) of // X axis (i.e. the Y's differ); if so, +X ray could @@ -168,6 +174,10 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins tx = points[i][0]; ty = points[i][1]; + if (MPL_notisfinite64(tx) || MPL_notisfinite64(ty)) { + continue; + } + yflag1 = (vty1 >= ty); if (yflag0[i] != yflag1) { if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {