{"action":"created","comment":{"url":"https://api.github.com/repos/pzivich/zepid/pulls/comments/241064629","pull_request_review_id":184242726,"id":241064629,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTA2NDYyOQ==","diff_hunk":"@@ -743,7 +892,65 @@ def summary(self, decimal=3):\n         print('Missing T:   ', self._missing_t)\n         print('======================================================================')\n \n+    def plot(self, measure='incidence_rate_difference', color='k', center=0):\n+        \"\"\"Plot the incidence rate differences or the incidence rates along with their corresponding confidence\n+        intervals. This option is an alternative to summary(), which displays results in a table format.\n+\n+        Parameters\n+        ----------\n+        measure : str, optional\n+            Whether to display incidence rate ratios or incidence rates. Default is to display the incidence rate\n+            differences. Options are;\n+            * 'incidence_rate_difference'  : display incidence rate differences\n+            * 'incidence_rate'             : display incidence rates\n+        color : str, optional\n+            Color to display points and confidence limits. Allows any valid matplotlib colors\n+        center : str, optional\n+            Sets a reference line. For the incidence rate difference, the reference line defaults to 0. For incidence\n+            rates, no reference line is displayed.\n+\n+        Returns\n+        -------\n+        matplotlib axes\n+        \"\"\"\n+        if measure == 'incidence_rate_difference':\n+            ax = _plotter(estimate=self.results['IncRateDiff'], lcl=self.results['IRD_LCL'],\n+                          ucl=self.results['IRR_UCL'], labels=self.results.index,\n+                          center=center, color=color)\n+            ax.set_title('Incidence Rate Difference')\n+        elif measure == 'incidence_rate':\n+            ax = _plotter(estimate=self.results['IncRate'], lcl=self.results['IncRate_LCL'],\n+                          ucl=self.results['IncRate_UCL'], labels=self.results.index,\n+                          center=np.nan, color=color)\n+            ax.set_title('Incidence Rate')\n+            ax.set_xlim([0, 1])\n+        else:\n+            raise ValueError('Must specify either \"incidence_rate_difference\" or \"incidence_rate\" for plots')\n+        return ax\n+\n+\n+def _plotter(estimate, lcl, ucl, labels, center=0, color='k'):\n+    \"\"\"Plot functionality to be used by all the measure classes. Hidden functional for all the other plotting\n+    functionalities\n+    \"\"\"\n+    ypoints = [i for i in range(len(labels))]","path":"zepid/base.py","position":242,"original_position":242,"commit_id":"38882047e75ca024f3590512b672c3564c3413fe","original_commit_id":"38882047e75ca024f3590512b672c3564c3413fe","user":{"login":"CamDavidsonPilon","id":884032,"node_id":"MDQ6VXNlcjg4NDAzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/884032?v=4","gravatar_id":"","url":"https://api.github.com/users/CamDavidsonPilon","html_url":"https://github.com/CamDavidsonPilon","followers_url":"https://api.github.com/users/CamDavidsonPilon/followers","following_url":"https://api.github.com/users/CamDavidsonPilon/following{/other_user}","gists_url":"https://api.github.com/users/CamDavidsonPilon/gists{/gist_id}","starred_url":"https://api.github.com/users/CamDavidsonPilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CamDavidsonPilon/subscriptions","organizations_url":"https://api.github.com/users/CamDavidsonPilon/orgs","repos_url":"https://api.github.com/users/CamDavidsonPilon/repos","events_url":"https://api.github.com/users/CamDavidsonPilon/events{/privacy}","received_events_url":"https://api.github.com/users/CamDavidsonPilon/received_events","type":"User","site_admin":false},"body":"is this the same as `range(len(labels))`?","created_at":"2018-12-12T15:39:08Z","updated_at":"2018-12-12T15:39:09Z","html_url":"https://github.com/pzivich/zepid/pull/35#discussion_r241064629","pull_request_url":"https://api.github.com/repos/pzivich/zepid/pulls/35","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pzivich/zepid/pulls/comments/241064629"},"html":{"href":"https://github.com/pzivich/zepid/pull/35#discussion_r241064629"},"pull_request":{"href":"https://api.github.com/repos/pzivich/zepid/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/pzivich/zepid/pulls/35","id":232417950,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDE3OTUw","html_url":"https://github.com/pzivich/zepid/pull/35","diff_url":"https://github.com/pzivich/zepid/pull/35.diff","patch_url":"https://github.com/pzivich/zepid/pull/35.patch","issue_url":"https://api.github.com/repos/pzivich/zepid/issues/35","number":35,"state":"open","locked":false,"title":"V0.4.0","user":{"login":"pzivich","id":32672909,"node_id":"MDQ6VXNlcjMyNjcyOTA5","avatar_url":"https://avatars0.githubusercontent.com/u/32672909?v=4","gravatar_id":"","url":"https://api.github.com/users/pzivich","html_url":"https://github.com/pzivich","followers_url":"https://api.github.com/users/pzivich/followers","following_url":"https://api.github.com/users/pzivich/following{/other_user}","gists_url":"https://api.github.com/users/pzivich/gists{/gist_id}","starred_url":"https://api.github.com/users/pzivich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzivich/subscriptions","organizations_url":"https://api.github.com/users/pzivich/orgs","repos_url":"https://api.github.com/users/pzivich/repos","events_url":"https://api.github.com/users/pzivich/events{/privacy}","received_events_url":"https://api.github.com/users/pzivich/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-20T18:28:46Z","updated_at":"2018-12-12T15:39:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4425a6df34c0404d86653c5ac5f3299179c8535d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pzivich/zepid/pulls/35/commits","review_comments_url":"https://api.github.com/repos/pzivich/zepid/pulls/35/comments","review_comment_url":"https://api.github.com/repos/pzivich/zepid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pzivich/zepid/issues/35/comments","statuses_url":"https://api.github.com/repos/pzivich/zepid/statuses/38882047e75ca024f3590512b672c3564c3413fe","head":{"label":"pzivich:v0.4.0","ref":"v0.4.0","sha":"38882047e75ca024f3590512b672c3564c3413fe","user":{"login":"pzivich","id":32672909,"node_id":"MDQ6VXNlcjMyNjcyOTA5","avatar_url":"https://avatars0.githubusercontent.com/u/32672909?v=4","gravatar_id":"","url":"https://api.github.com/users/pzivich","html_url":"https://github.com/pzivich","followers_url":"https://api.github.com/users/pzivich/followers","following_url":"https://api.github.com/users/pzivich/following{/other_user}","gists_url":"https://api.github.com/users/pzivich/gists{/gist_id}","starred_url":"https://api.github.com/users/pzivich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzivich/subscriptions","organizations_url":"https://api.github.com/users/pzivich/orgs","repos_url":"https://api.github.com/users/pzivich/repos","events_url":"https://api.github.com/users/pzivich/events{/privacy}","received_events_url":"https://api.github.com/users/pzivich/received_events","type":"User","site_admin":false},"repo":{"id":106410048,"node_id":"MDEwOlJlcG9zaXRvcnkxMDY0MTAwNDg=","name":"zepid","full_name":"pzivich/zepid","private":false,"owner":{"login":"pzivich","id":32672909,"node_id":"MDQ6VXNlcjMyNjcyOTA5","avatar_url":"https://avatars0.githubusercontent.com/u/32672909?v=4","gravatar_id":"","url":"https://api.github.com/users/pzivich","html_url":"https://github.com/pzivich","followers_url":"https://api.github.com/users/pzivich/followers","following_url":"https://api.github.com/users/pzivich/following{/other_user}","gists_url":"https://api.github.com/users/pzivich/gists{/gist_id}","starred_url":"https://api.github.com/users/pzivich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzivich/subscriptions","organizations_url":"https://api.github.com/users/pzivich/orgs","repos_url":"https://api.github.com/users/pzivich/repos","events_url":"https://api.github.com/users/pzivich/events{/privacy}","received_events_url":"https://api.github.com/users/pzivich/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pzivich/zepid","description":"Epidemiology analysis package","fork":false,"url":"https://api.github.com/repos/pzivich/zepid","forks_url":"https://api.github.com/repos/pzivich/zepid/forks","keys_url":"https://api.github.com/repos/pzivich/zepid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pzivich/zepid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pzivich/zepid/teams","hooks_url":"https://api.github.com/repos/pzivich/zepid/hooks","issue_events_url":"https://api.github.com/repos/pzivich/zepid/issues/events{/number}","events_url":"https://api.github.com/repos/pzivich/zepid/events","assignees_url":"https://api.github.com/repos/pzivich/zepid/assignees{/user}","branches_url":"https://api.github.com/repos/pzivich/zepid/branches{/branch}","tags_url":"https://api.github.com/repos/pzivich/zepid/tags","blobs_url":"https://api.github.com/repos/pzivich/zepid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pzivich/zepid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pzivich/zepid/git/refs{/sha}","trees_url":"https://api.github.com/repos/pzivich/zepid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pzivich/zepid/statuses/{sha}","languages_url":"https://api.github.com/repos/pzivich/zepid/languages","stargazers_url":"https://api.github.com/repos/pzivich/zepid/stargazers","contributors_url":"https://api.github.com/repos/pzivich/zepid/contributors","subscribers_url":"https://api.github.com/repos/pzivich/zepid/subscribers","subscription_url":"https://api.github.com/repos/pzivich/zepid/subscription","commits_url":"https://api.github.com/repos/pzivich/zepid/commits{/sha}","git_commits_url":"https://api.github.com/repos/pzivich/zepid/git/commits{/sha}","comments_url":"https://api.github.com/repos/pzivich/zepid/comments{/number}","issue_comment_url":"https://api.github.com/repos/pzivich/zepid/issues/comments{/number}","contents_url":"https://api.github.com/repos/pzivich/zepid/contents/{+path}","compare_url":"https://api.github.com/repos/pzivich/zepid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pzivich/zepid/merges","archive_url":"https://api.github.com/repos/pzivich/zepid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pzivich/zepid/downloads","issues_url":"https://api.github.com/repos/pzivich/zepid/issues{/number}","pulls_url":"https://api.github.com/repos/pzivich/zepid/pulls{/number}","milestones_url":"https://api.github.com/repos/pzivich/zepid/milestones{/number}","notifications_url":"https://api.github.com/repos/pzivich/zepid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pzivich/zepid/labels{/name}","releases_url":"https://api.github.com/repos/pzivich/zepid/releases{/id}","deployments_url":"https://api.github.com/repos/pzivich/zepid/deployments","created_at":"2017-10-10T11:47:47Z","updated_at":"2018-11-08T21:13:46Z","pushed_at":"2018-12-12T13:39:05Z","git_url":"git://github.com/pzivich/zepid.git","ssh_url":"git@github.com:pzivich/zepid.git","clone_url":"https://github.com/pzivich/zepid.git","svn_url":"https://github.com/pzivich/zepid","homepage":"http://zepid.readthedocs.org","size":5508,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":17,"watchers":5,"default_branch":"master"}},"base":{"label":"pzivich:master","ref":"master","sha":"84d41fa7cba5db71bdd9745cf778adb4a6694556","user":{"login":"pzivich","id":32672909,"node_id":"MDQ6VXNlcjMyNjcyOTA5","avatar_url":"https://avatars0.githubusercontent.com/u/32672909?v=4","gravatar_id":"","url":"https://api.github.com/users/pzivich","html_url":"https://github.com/pzivich","followers_url":"https://api.github.com/users/pzivich/followers","following_url":"https://api.github.com/users/pzivich/following{/other_user}","gists_url":"https://api.github.com/users/pzivich/gists{/gist_id}","starred_url":"https://api.github.com/users/pzivich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzivich/subscriptions","organizations_url":"https://api.github.com/users/pzivich/orgs","repos_url":"https://api.github.com/users/pzivich/repos","events_url":"https://api.github.com/users/pzivich/events{/privacy}","received_events_url":"https://api.github.com/users/pzivich/received_events","type":"User","site_admin":false},"repo":{"id":106410048,"node_id":"MDEwOlJlcG9zaXRvcnkxMDY0MTAwNDg=","name":"zepid","full_name":"pzivich/zepid","private":false,"owner":{"login":"pzivich","id":32672909,"node_id":"MDQ6VXNlcjMyNjcyOTA5","avatar_url":"https://avatars0.githubusercontent.com/u/32672909?v=4","gravatar_id":"","url":"https://api.github.com/users/pzivich","html_url":"https://github.com/pzivich","followers_url":"https://api.github.com/users/pzivich/followers","following_url":"https://api.github.com/users/pzivich/following{/other_user}","gists_url":"https://api.github.com/users/pzivich/gists{/gist_id}","starred_url":"https://api.github.com/users/pzivich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzivich/subscriptions","organizations_url":"https://api.github.com/users/pzivich/orgs","repos_url":"https://api.github.com/users/pzivich/repos","events_url":"https://api.github.com/users/pzivich/events{/privacy}","received_events_url":"https://api.github.com/users/pzivich/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pzivich/zepid","description":"Epidemiology analysis package","fork":false,"url":"https://api.github.com/repos/pzivich/zepid","forks_url":"https://api.github.com/repos/pzivich/zepid/forks","keys_url":"https://api.github.com/repos/pzivich/zepid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pzivich/zepid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pzivich/zepid/teams","hooks_url":"https://api.github.com/repos/pzivich/zepid/hooks","issue_events_url":"https://api.github.com/repos/pzivich/zepid/issues/events{/number}","events_url":"https://api.github.com/repos/pzivich/zepid/events","assignees_url":"https://api.github.com/repos/pzivich/zepid/assignees{/user}","branches_url":"https://api.github.com/repos/pzivich/zepid/branches{/branch}","tags_url":"https://api.github.com/repos/pzivich/zepid/tags","blobs_url":"https://api.github.com/repos/pzivich/zepid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pzivich/zepid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pzivich/zepid/git/refs{/sha}","trees_url":"https://api.github.com/repos/pzivich/zepid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pzivich/zepid/statuses/{sha}","languages_url":"https://api.github.com/repos/pzivich/zepid/languages","stargazers_url":"https://api.github.com/repos/pzivich/zepid/stargazers","contributors_url":"https://api.github.com/repos/pzivich/zepid/contributors","subscribers_url":"https://api.github.com/repos/pzivich/zepid/subscribers","subscription_url":"https://api.github.com/repos/pzivich/zepid/subscription","commits_url":"https://api.github.com/repos/pzivich/zepid/commits{/sha}","git_commits_url":"https://api.github.com/repos/pzivich/zepid/git/commits{/sha}","comments_url":"https://api.github.com/repos/pzivich/zepid/comments{/number}","issue_comment_url":"https://api.github.com/repos/pzivich/zepid/issues/comments{/number}","contents_url":"https://api.github.com/repos/pzivich/zepid/contents/{+path}","compare_url":"https://api.github.com/repos/pzivich/zepid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pzivich/zepid/merges","archive_url":"https://api.github.com/repos/pzivich/zepid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pzivich/zepid/downloads","issues_url":"https://api.github.com/repos/pzivich/zepid/issues{/number}","pulls_url":"https://api.github.com/repos/pzivich/zepid/pulls{/number}","milestones_url":"https://api.github.com/repos/pzivich/zepid/milestones{/number}","notifications_url":"https://api.github.com/repos/pzivich/zepid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pzivich/zepid/labels{/name}","releases_url":"https://api.github.com/repos/pzivich/zepid/releases{/id}","deployments_url":"https://api.github.com/repos/pzivich/zepid/deployments","created_at":"2017-10-10T11:47:47Z","updated_at":"2018-11-08T21:13:46Z","pushed_at":"2018-12-12T13:39:05Z","git_url":"git://github.com/pzivich/zepid.git","ssh_url":"git@github.com:pzivich/zepid.git","clone_url":"https://github.com/pzivich/zepid.git","svn_url":"https://github.com/pzivich/zepid","homepage":"http://zepid.readthedocs.org","size":5508,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":17,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pzivich/zepid/pulls/35"},"html":{"href":"https://github.com/pzivich/zepid/pull/35"},"issue":{"href":"https://api.github.com/repos/pzivich/zepid/issues/35"},"comments":{"href":"https://api.github.com/repos/pzivich/zepid/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/pzivich/zepid/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/pzivich/zepid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pzivich/zepid/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/pzivich/zepid/statuses/38882047e75ca024f3590512b672c3564c3413fe"}},"author_association":"OWNER"}}
{"actor":{"display_login":"CamDavidsonPilon"}}