{"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/33354819","id":33354819,"diff_hunk":"@@ -1255,3 +1260,47 @@ def get_slicer(display_mode):\n def get_projector(display_mode):\n     \"Internal function to retrieve a projector\"\n     return get_create_display_fun(display_mode, PROJECTORS)\n+\n+\n+def check_threshold(threshold, data, percentile_calculate, name):\n+    \"\"\"\n+    Checks that the given threshold has an accepted string value\n+    and returns a threshold computed on the data. Use case of data\n+    is mainly from plot_connectome and plot_prob_atlas.\n+\n+    Parameters\n+    ----------\n+    threshold: a real value or a percentage in string or list of these.\n+        For example, if threshold is a percentage expressed in a string\n+        it must finish with a percent sign like \"99.7%\".\n+    data: a numpy array of a map or a numpy array of a symmetric matrix.\n+    percentile_calculate: define the name of a specific percentile","path":"nilearn/plotting/displays.py","position":48,"original_position":48,"commit_id":"20836a58ccc6b381dd41a222169a026fcc625312","original_commit_id":"20836a58ccc6b381dd41a222169a026fcc625312","user":{"login":"KamalakerDadi","id":11410385,"avatar_url":"https://avatars.githubusercontent.com/u/11410385?v=3","gravatar_id":"","url":"https://api.github.com/users/KamalakerDadi","html_url":"https://github.com/KamalakerDadi","followers_url":"https://api.github.com/users/KamalakerDadi/followers","following_url":"https://api.github.com/users/KamalakerDadi/following{/other_user}","gists_url":"https://api.github.com/users/KamalakerDadi/gists{/gist_id}","starred_url":"https://api.github.com/users/KamalakerDadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamalakerDadi/subscriptions","organizations_url":"https://api.github.com/users/KamalakerDadi/orgs","repos_url":"https://api.github.com/users/KamalakerDadi/repos","events_url":"https://api.github.com/users/KamalakerDadi/events{/privacy}","received_events_url":"https://api.github.com/users/KamalakerDadi/received_events","type":"User","site_admin":false},"body":"I actually checked with ```plot_prob_atlas``` by changing the string of the function. I may also be wrong. Can you please elaborate a bit on this ? ```exact=True```","created_at":"2015-06-26T13:23:37Z","updated_at":"2015-06-26T13:23:37Z","html_url":"https://github.com/nilearn/nilearn/pull/589#discussion_r33354819","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/589","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/33354819"},"html":{"href":"https://github.com/nilearn/nilearn/pull/589#discussion_r33354819"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/589"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/589","id":35574810,"html_url":"https://github.com/nilearn/nilearn/pull/589","diff_url":"https://github.com/nilearn/nilearn/pull/589.diff","patch_url":"https://github.com/nilearn/nilearn/pull/589.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/589","number":589,"state":"open","locked":false,"title":"Adding a 4Dplot function displaying as a contours in img_plotting ","user":{"login":"KamalakerDadi","id":11410385,"avatar_url":"https://avatars.githubusercontent.com/u/11410385?v=3","gravatar_id":"","url":"https://api.github.com/users/KamalakerDadi","html_url":"https://github.com/KamalakerDadi","followers_url":"https://api.github.com/users/KamalakerDadi/followers","following_url":"https://api.github.com/users/KamalakerDadi/following{/other_user}","gists_url":"https://api.github.com/users/KamalakerDadi/gists{/gist_id}","starred_url":"https://api.github.com/users/KamalakerDadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamalakerDadi/subscriptions","organizations_url":"https://api.github.com/users/KamalakerDadi/orgs","repos_url":"https://api.github.com/users/KamalakerDadi/repos","events_url":"https://api.github.com/users/KamalakerDadi/events{/privacy}","received_events_url":"https://api.github.com/users/KamalakerDadi/received_events","type":"User","site_admin":false},"body":"Edited by @AlexandreAbraham\r\n- [x] thicken contour lines\r\n- [x] add an example of plotting with several atlases\r\n- [ ] make code PEP8 compliant\r\n- [x] for thresholding, accept one value, or a list of values, or a percentage, or a list of percentage\r\n\r\nI have basically utilised the content of the code and documentation of each arguments for writing a function called ```plot_4d``` in ```img_plotting```.\r\nHere is the code snippet to call the function ```plot_4d``` for plotting in contours. \r\nHarvard Oxford Atlas:\r\n```python\r\nfrom nilearn import datasets, plotting\r\nimport matplotlib.pyplot as plt\r\natlas_img_4D, labels = datasets.fetch_harvard_oxford('cort-prob-2mm')\r\ndisplay = plotting.img_plotting.plot_4d(atlas_img_4D)\r\nplt.show()\r\n```\r\nResult:\r\n![figure_1](https://cloud.githubusercontent.com/assets/11410385/7667394/2952f1ae-fc06-11e4-8055-70f6ba96a2b2.png)\r\n\r\n\r\nMSDL Atlas:\r\n```python\r\nfrom nilearn import datasets, plotting\r\nimport matplotlib.pyplot as plt\r\natlas_data = datasets.fetch_msdl_atlas()\r\natlas_filename = atlas_data.maps\r\ndisplay = plotting.img_plotting.plot_4d(atlas_filename)\r\nplt.show()\r\n```\r\nResult:\r\n![figuremsdl](https://cloud.githubusercontent.com/assets/11410385/7667400/54c4ae68-fc06-11e4-8a05-cfdb56c63ad8.png)\r\n\r\n","created_at":"2015-05-16T18:02:05Z","updated_at":"2015-06-26T13:23:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08860a97c4bcc246d2c12417998403b7fb241786","assignee":{"login":"KamalakerDadi","id":11410385,"avatar_url":"https://avatars.githubusercontent.com/u/11410385?v=3","gravatar_id":"","url":"https://api.github.com/users/KamalakerDadi","html_url":"https://github.com/KamalakerDadi","followers_url":"https://api.github.com/users/KamalakerDadi/followers","following_url":"https://api.github.com/users/KamalakerDadi/following{/other_user}","gists_url":"https://api.github.com/users/KamalakerDadi/gists{/gist_id}","starred_url":"https://api.github.com/users/KamalakerDadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamalakerDadi/subscriptions","organizations_url":"https://api.github.com/users/KamalakerDadi/orgs","repos_url":"https://api.github.com/users/KamalakerDadi/repos","events_url":"https://api.github.com/users/KamalakerDadi/events{/privacy}","received_events_url":"https://api.github.com/users/KamalakerDadi/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/589/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/589/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/589/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/20836a58ccc6b381dd41a222169a026fcc625312","head":{"label":"KamalakerDadi:fix_588","ref":"fix_588","sha":"20836a58ccc6b381dd41a222169a026fcc625312","user":{"login":"KamalakerDadi","id":11410385,"avatar_url":"https://avatars.githubusercontent.com/u/11410385?v=3","gravatar_id":"","url":"https://api.github.com/users/KamalakerDadi","html_url":"https://github.com/KamalakerDadi","followers_url":"https://api.github.com/users/KamalakerDadi/followers","following_url":"https://api.github.com/users/KamalakerDadi/following{/other_user}","gists_url":"https://api.github.com/users/KamalakerDadi/gists{/gist_id}","starred_url":"https://api.github.com/users/KamalakerDadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamalakerDadi/subscriptions","organizations_url":"https://api.github.com/users/KamalakerDadi/orgs","repos_url":"https://api.github.com/users/KamalakerDadi/repos","events_url":"https://api.github.com/users/KamalakerDadi/events{/privacy}","received_events_url":"https://api.github.com/users/KamalakerDadi/received_events","type":"User","site_admin":false},"repo":{"id":32379132,"name":"nilearn","full_name":"KamalakerDadi/nilearn","owner":{"login":"KamalakerDadi","id":11410385,"avatar_url":"https://avatars.githubusercontent.com/u/11410385?v=3","gravatar_id":"","url":"https://api.github.com/users/KamalakerDadi","html_url":"https://github.com/KamalakerDadi","followers_url":"https://api.github.com/users/KamalakerDadi/followers","following_url":"https://api.github.com/users/KamalakerDadi/following{/other_user}","gists_url":"https://api.github.com/users/KamalakerDadi/gists{/gist_id}","starred_url":"https://api.github.com/users/KamalakerDadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamalakerDadi/subscriptions","organizations_url":"https://api.github.com/users/KamalakerDadi/orgs","repos_url":"https://api.github.com/users/KamalakerDadi/repos","events_url":"https://api.github.com/users/KamalakerDadi/events{/privacy}","received_events_url":"https://api.github.com/users/KamalakerDadi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KamalakerDadi/nilearn","description":"Machine learning for NeuroImaging in Python","fork":true,"url":"https://api.github.com/repos/KamalakerDadi/nilearn","forks_url":"https://api.github.com/repos/KamalakerDadi/nilearn/forks","keys_url":"https://api.github.com/repos/KamalakerDadi/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KamalakerDadi/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KamalakerDadi/nilearn/teams","hooks_url":"https://api.github.com/repos/KamalakerDadi/nilearn/hooks","issue_events_url":"https://api.github.com/repos/KamalakerDadi/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/KamalakerDadi/nilearn/events","assignees_url":"https://api.github.com/repos/KamalakerDadi/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/KamalakerDadi/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/KamalakerDadi/nilearn/tags","blobs_url":"https://api.github.com/repos/KamalakerDadi/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KamalakerDadi/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KamalakerDadi/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/KamalakerDadi/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KamalakerDadi/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/KamalakerDadi/nilearn/languages","stargazers_url":"https://api.github.com/repos/KamalakerDadi/nilearn/stargazers","contributors_url":"https://api.github.com/repos/KamalakerDadi/nilearn/contributors","subscribers_url":"https://api.github.com/repos/KamalakerDadi/nilearn/subscribers","subscription_url":"https://api.github.com/repos/KamalakerDadi/nilearn/subscription","commits_url":"https://api.github.com/repos/KamalakerDadi/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/KamalakerDadi/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/KamalakerDadi/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/KamalakerDadi/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/KamalakerDadi/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/KamalakerDadi/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KamalakerDadi/nilearn/merges","archive_url":"https://api.github.com/repos/KamalakerDadi/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KamalakerDadi/nilearn/downloads","issues_url":"https://api.github.com/repos/KamalakerDadi/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/KamalakerDadi/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/KamalakerDadi/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/KamalakerDadi/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KamalakerDadi/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/KamalakerDadi/nilearn/releases{/id}","created_at":"2015-03-17T07:55:36Z","updated_at":"2015-04-29T07:58:19Z","pushed_at":"2015-06-26T11:01:05Z","git_url":"git://github.com/KamalakerDadi/nilearn.git","ssh_url":"git@github.com:KamalakerDadi/nilearn.git","clone_url":"https://github.com/KamalakerDadi/nilearn.git","svn_url":"https://github.com/KamalakerDadi/nilearn","homepage":"http://nilearn.github.io","size":6860,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"nilearn:master","ref":"master","sha":"62a0ae733124d40ea401a50d11af90cc7f03e6dc","user":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"repo":{"id":1235740,"name":"nilearn","full_name":"nilearn/nilearn","owner":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nilearn/nilearn","description":"Machine learning for NeuroImaging in Python","fork":false,"url":"https://api.github.com/repos/nilearn/nilearn","forks_url":"https://api.github.com/repos/nilearn/nilearn/forks","keys_url":"https://api.github.com/repos/nilearn/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nilearn/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nilearn/nilearn/teams","hooks_url":"https://api.github.com/repos/nilearn/nilearn/hooks","issue_events_url":"https://api.github.com/repos/nilearn/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/nilearn/nilearn/events","assignees_url":"https://api.github.com/repos/nilearn/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/nilearn/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/nilearn/nilearn/tags","blobs_url":"https://api.github.com/repos/nilearn/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nilearn/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nilearn/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nilearn/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/nilearn/nilearn/languages","stargazers_url":"https://api.github.com/repos/nilearn/nilearn/stargazers","contributors_url":"https://api.github.com/repos/nilearn/nilearn/contributors","subscribers_url":"https://api.github.com/repos/nilearn/nilearn/subscribers","subscription_url":"https://api.github.com/repos/nilearn/nilearn/subscription","commits_url":"https://api.github.com/repos/nilearn/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nilearn/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nilearn/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nilearn/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/nilearn/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/nilearn/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nilearn/nilearn/merges","archive_url":"https://api.github.com/repos/nilearn/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nilearn/nilearn/downloads","issues_url":"https://api.github.com/repos/nilearn/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/nilearn/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/nilearn/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/nilearn/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nilearn/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/nilearn/nilearn/releases{/id}","created_at":"2011-01-09T19:02:23Z","updated_at":"2015-06-17T09:36:16Z","pushed_at":"2015-06-26T11:01:06Z","git_url":"git://github.com/nilearn/nilearn.git","ssh_url":"git@github.com:nilearn/nilearn.git","clone_url":"https://github.com/nilearn/nilearn.git","svn_url":"https://github.com/nilearn/nilearn","homepage":"http://nilearn.github.io","size":12518,"stargazers_count":92,"watchers_count":92,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":66,"forks":68,"open_issues":66,"watchers":92,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/589"},"html":{"href":"https://github.com/nilearn/nilearn/pull/589"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/589"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/589/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/589/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/589/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/20836a58ccc6b381dd41a222169a026fcc625312"}}}}