{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/38806352","id":38806352,"diff_hunk":"@@ -622,23 +622,29 @@ def recache(self, always=False):\n         if len(x) != len(y):\n             raise RuntimeError('xdata and ydata must be the same length')\n \n-        x = x.reshape((len(x), 1))\n-        y = y.reshape((len(y), 1))\n+        self._xy = np.empty((len(x), 2), dtype=np.float_)\n+        self._xy[:, 0] = x\n+        self._xy[:, 1] = y\n \n-        if ma.isMaskedArray(x) or ma.isMaskedArray(y):\n-            self._xy = ma.concatenate((x, y), 1)\n-        else:\n-            self._xy = np.concatenate((x, y), 1)\n         self._x = self._xy[:, 0]  # just a view\n         self._y = self._xy[:, 1]  # just a view\n \n         self._subslice = False\n-        if (self.axes and len(x) > 100 and self._is_sorted(x) and\n+        if (self.axes and len(x) > 1000 and self._is_sorted(x) and\n                 self.axes.name == 'rectilinear' and\n                 self.axes.get_xscale() == 'linear' and\n                 self._markevery is None and\n                 self.get_clip_on() is True):\n             self._subslice = True\n+            nanmask = np.isnan(x)\n+            if nanmask.any():\n+                self._x_filled = self._x.copy()","path":"lib/matplotlib/lines.py","position":45,"original_position":45,"commit_id":"3c2c0370964e5ee581fc63343f67c22f140e7fbc","original_commit_id":"3c2c0370964e5ee581fc63343f67c22f140e7fbc","user":{"login":"efiring","id":85125,"avatar_url":"https://avatars.githubusercontent.com/u/85125?v=3","gravatar_id":"","url":"https://api.github.com/users/efiring","html_url":"https://github.com/efiring","followers_url":"https://api.github.com/users/efiring/followers","following_url":"https://api.github.com/users/efiring/following{/other_user}","gists_url":"https://api.github.com/users/efiring/gists{/gist_id}","starred_url":"https://api.github.com/users/efiring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efiring/subscriptions","organizations_url":"https://api.github.com/users/efiring/orgs","repos_url":"https://api.github.com/users/efiring/repos","events_url":"https://api.github.com/users/efiring/events{/privacy}","received_events_url":"https://api.github.com/users/efiring/received_events","type":"User","site_admin":false},"body":"I could, but it would be inconsistent; all the similar attributes like `_x` and `_xy` are initialized only as needed, not in `__init__`.","created_at":"2015-09-05T02:31:29Z","updated_at":"2015-09-05T02:31:29Z","html_url":"https://github.com/matplotlib/matplotlib/pull/5031#discussion_r38806352","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/38806352"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/5031#discussion_r38806352"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031","id":44263586,"html_url":"https://github.com/matplotlib/matplotlib/pull/5031","diff_url":"https://github.com/matplotlib/matplotlib/pull/5031.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/5031.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5031","number":5031,"state":"open","locked":false,"title":"support subslicing when x is masked or has nans","user":{"login":"efiring","id":85125,"avatar_url":"https://avatars.githubusercontent.com/u/85125?v=3","gravatar_id":"","url":"https://api.github.com/users/efiring","html_url":"https://github.com/efiring","followers_url":"https://api.github.com/users/efiring/followers","following_url":"https://api.github.com/users/efiring/following{/other_user}","gists_url":"https://api.github.com/users/efiring/gists{/gist_id}","starred_url":"https://api.github.com/users/efiring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efiring/subscriptions","organizations_url":"https://api.github.com/users/efiring/orgs","repos_url":"https://api.github.com/users/efiring/repos","events_url":"https://api.github.com/users/efiring/events{/privacy}","received_events_url":"https://api.github.com/users/efiring/received_events","type":"User","site_admin":false},"body":"This also streamlines the handling of masked arrays and subslices in recache and draw.","created_at":"2015-09-04T21:32:31Z","updated_at":"2015-09-05T02:31:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab775ed95c5aa14b29a836dc249e02ee466d77d5","assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/18","html_url":"https://github.com/matplotlib/matplotlib/milestones/next%20point%20release","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/18/labels","id":970105,"number":18,"title":"next point release","description":"Next minor release.","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":325,"state":"open","created_at":"2015-02-07T21:22:30Z","updated_at":"2015-09-05T02:30:06Z","due_on":"2015-08-31T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5031/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/3c2c0370964e5ee581fc63343f67c22f140e7fbc","head":{"label":"efiring:subslice","ref":"subslice","sha":"3c2c0370964e5ee581fc63343f67c22f140e7fbc","user":{"login":"efiring","id":85125,"avatar_url":"https://avatars.githubusercontent.com/u/85125?v=3","gravatar_id":"","url":"https://api.github.com/users/efiring","html_url":"https://github.com/efiring","followers_url":"https://api.github.com/users/efiring/followers","following_url":"https://api.github.com/users/efiring/following{/other_user}","gists_url":"https://api.github.com/users/efiring/gists{/gist_id}","starred_url":"https://api.github.com/users/efiring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efiring/subscriptions","organizations_url":"https://api.github.com/users/efiring/orgs","repos_url":"https://api.github.com/users/efiring/repos","events_url":"https://api.github.com/users/efiring/events{/privacy}","received_events_url":"https://api.github.com/users/efiring/received_events","type":"User","site_admin":false},"repo":{"id":1419791,"name":"matplotlib","full_name":"efiring/matplotlib","owner":{"login":"efiring","id":85125,"avatar_url":"https://avatars.githubusercontent.com/u/85125?v=3","gravatar_id":"","url":"https://api.github.com/users/efiring","html_url":"https://github.com/efiring","followers_url":"https://api.github.com/users/efiring/followers","following_url":"https://api.github.com/users/efiring/following{/other_user}","gists_url":"https://api.github.com/users/efiring/gists{/gist_id}","starred_url":"https://api.github.com/users/efiring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efiring/subscriptions","organizations_url":"https://api.github.com/users/efiring/orgs","repos_url":"https://api.github.com/users/efiring/repos","events_url":"https://api.github.com/users/efiring/events{/privacy}","received_events_url":"https://api.github.com/users/efiring/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/efiring/matplotlib","description":"","fork":true,"url":"https://api.github.com/repos/efiring/matplotlib","forks_url":"https://api.github.com/repos/efiring/matplotlib/forks","keys_url":"https://api.github.com/repos/efiring/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/efiring/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/efiring/matplotlib/teams","hooks_url":"https://api.github.com/repos/efiring/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/efiring/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/efiring/matplotlib/events","assignees_url":"https://api.github.com/repos/efiring/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/efiring/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/efiring/matplotlib/tags","blobs_url":"https://api.github.com/repos/efiring/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/efiring/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/efiring/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/efiring/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/efiring/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/efiring/matplotlib/languages","stargazers_url":"https://api.github.com/repos/efiring/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/efiring/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/efiring/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/efiring/matplotlib/subscription","commits_url":"https://api.github.com/repos/efiring/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/efiring/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/efiring/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/efiring/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/efiring/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/efiring/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/efiring/matplotlib/merges","archive_url":"https://api.github.com/repos/efiring/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/efiring/matplotlib/downloads","issues_url":"https://api.github.com/repos/efiring/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/efiring/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/efiring/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/efiring/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/efiring/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/efiring/matplotlib/releases{/id}","created_at":"2011-02-28T01:01:50Z","updated_at":"2015-05-03T21:31:26Z","pushed_at":"2015-09-04T21:30:38Z","git_url":"git://github.com/efiring/matplotlib.git","ssh_url":"git@github.com:efiring/matplotlib.git","clone_url":"https://github.com/efiring/matplotlib.git","svn_url":"https://github.com/efiring/matplotlib","homepage":"","size":218433,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"0bbf040697837243ce34a2a9b2273185298f98e8","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2015-09-05T01:57:48Z","pushed_at":"2015-09-05T01:09:53Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":276920,"stargazers_count":2803,"watchers_count":2803,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1435,"mirror_url":null,"open_issues_count":622,"forks":1435,"open_issues":622,"watchers":2803,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/5031"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/5031"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/5031/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/5031/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/3c2c0370964e5ee581fc63343f67c22f140e7fbc"}}}}