{"action":"closed","number":454,"pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454","id":28294758,"html_url":"https://github.com/hyperspy/hyperspy/pull/454","diff_url":"https://github.com/hyperspy/hyperspy/pull/454.diff","patch_url":"https://github.com/hyperspy/hyperspy/pull/454.patch","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454","number":454,"state":"closed","locked":false,"title":"NEW: Implementation of plot_images utility function","user":{"login":"jat255","id":1278301,"avatar_url":"https://avatars.githubusercontent.com/u/1278301?v=3","gravatar_id":"","url":"https://api.github.com/users/jat255","html_url":"https://github.com/jat255","followers_url":"https://api.github.com/users/jat255/followers","following_url":"https://api.github.com/users/jat255/following{/other_user}","gists_url":"https://api.github.com/users/jat255/gists{/gist_id}","starred_url":"https://api.github.com/users/jat255/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jat255/subscriptions","organizations_url":"https://api.github.com/users/jat255/orgs","repos_url":"https://api.github.com/users/jat255/repos","events_url":"https://api.github.com/users/jat255/events{/privacy}","received_events_url":"https://api.github.com/users/jat255/received_events","type":"User","site_admin":false},"body":"Resolves #452.\r\n\r\nThis PR can be used as a starting point for the `plot_images` function. The majority of the code has been lifted from the `plot_decomposition_loadings()` method, and adapted so I could plot whichever images I wanted.\r\n\r\n\r\nHOLDS:\r\n- [x] Waiting on #160 before merging\r\n\r\nFOR DEBATE:\r\n- [ ] debate merits of `_deepcopy`\r\n- [x] ~~change default `tight_layout` ?~~\r\n\r\nTODO:\r\n- [ ] add testing notebook to hyperspy demos\r\n- [x] ~~let x and y axes be undefined and remove if the case~~\r\n- [x] ~~look into `perc` with `vmin/vmax` in `image.plot()`~~\r\n- [x] ~~replace example of EDS data with data from pburdet~~\r\n- [x] ~~remove print statements from `image.plot()` code~~\r\n- [x] ~~implement (or not) for 3D RGB images~~\r\n- [x] ~~docstring like numpy style~~\r\n- [x] ~~raise `ValueError` for incorrect scalebar input~~\r\n- [x] ~~investigate reshaping~~\r\n- [x] ~~pep8 compliance~~\r\n- [x] ~~move imports to beginning of file~~\r\n- [x] ~~Documentation in user guide~~\r\n- [x] ~~improve labeling of similar signals~~\r\n- [x] ~~Prevent `plot_images()` from causing iteration of prior calls to `image.plot()`~~ \r\n- [x] ~~If images have different scales, they get squeezed. The aspect of plt.imshow should be optimized as it is in image.plot()~~\r\n- [x] ~~refactor `plot_scalebar` as `scalebar` (`None, 'all', or list of int choosing which plots should have the scalebar`)~~\r\n- [x] ~~one option for `axes` (`None, 'default' (which is ticks and labels), 'ticks' (no labels)`)~~\r\n- [x] ~~Handling of input if a `Signal` instance is supplied instead of a list (like the output of `get_decomposition_loadings()`~~ This actually already worked because Signal is iterable (I think), so I just added some checks to make sure it's a Signal if not a list. I'd be happy for suggestions of improvement on this part.\r\n- [x] ~~Adding option of fixing the colormap so it is shared between all images, rather than having independent ones for all the individual images~~\r\n- [x] ~~Plot scale bar option~~\r\n- [x] ~~Plot axes option~~ \r\n- [x] ~~Pass extra args and kwargs to `imshow`~~\r\n- [x] ~~Option to disable titles~~\r\n- [x] ~~Add figure keyword to pass to existing MPL figure~~\r\n- [x] ~~Set default figsize to `k * (per_row, rows)` where `k = np.max(plt.rcParams['figure.figsize']) / np.max(per_row, rows)`~~\r\n- [x] ~~change default `label_list` to list of signal titles (`metadata.General.title`)~~\r\n- [x] ~~enable plotting when `label_list` is not the same length, printing useful output to user~~\r\n- [x] ~~implement single option `label`, which can be a `str` or a `list`~~\r\n- [x] ~~add support for RGB images~~\r\n- [x] ~~refactor `signals` to `images`~~\r\n- [x] ~~implement padding option to control spacing between images~~\r\n- [x] ~~Investigate switching to GridSpec for layout?~~\r\n    - *I don't think this is necessary, since using `rect` in `plt.tight_layout` solves the issue of overlapping colorbar*\r\n- [x] ~~implement single option for `colorbar` (`None, 'default', or 'single'`)~~\r\n- [x] ~~Fix colorbar placement~~\r\n- [x] ~~default cmap could be the one set generally with pyplot.set_cmap()~~\r\n- [x] ~~The label of the axis should be the same as image.plot(): \"name (units)\"~~\r\n- [x] ~~Should this function return a list of axes as plot_spectra?~~","created_at":"2015-01-29T16:50:41Z","updated_at":"2015-04-06T11:17:29Z","closed_at":"2015-04-06T11:17:29Z","merged_at":"2015-04-06T11:17:29Z","merge_commit_sha":"dba1686dc558049f4e1e1b9a08297e6f2481ea24","assignee":null,"milestone":{"url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/2","html_url":"https://github.com/hyperspy/hyperspy/milestones/0.8","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones/2/labels","id":616623,"number":2,"title":"0.8","description":"","creator":{"login":"francisco-dlp","id":989719,"avatar_url":"https://avatars.githubusercontent.com/u/989719?v=3","gravatar_id":"","url":"https://api.github.com/users/francisco-dlp","html_url":"https://github.com/francisco-dlp","followers_url":"https://api.github.com/users/francisco-dlp/followers","following_url":"https://api.github.com/users/francisco-dlp/following{/other_user}","gists_url":"https://api.github.com/users/francisco-dlp/gists{/gist_id}","starred_url":"https://api.github.com/users/francisco-dlp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisco-dlp/subscriptions","organizations_url":"https://api.github.com/users/francisco-dlp/orgs","repos_url":"https://api.github.com/users/francisco-dlp/repos","events_url":"https://api.github.com/users/francisco-dlp/events{/privacy}","received_events_url":"https://api.github.com/users/francisco-dlp/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":68,"state":"open","created_at":"2014-04-01T11:09:41Z","updated_at":"2015-04-06T11:17:29Z","due_on":"2015-03-26T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454/commits","review_comments_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454/comments","review_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454/comments","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/0b240868c0655463b79b0612b67e0af732926f12","head":{"label":"jat255:ENH_plot_images_function","ref":"ENH_plot_images_function","sha":"0b240868c0655463b79b0612b67e0af732926f12","user":{"login":"jat255","id":1278301,"avatar_url":"https://avatars.githubusercontent.com/u/1278301?v=3","gravatar_id":"","url":"https://api.github.com/users/jat255","html_url":"https://github.com/jat255","followers_url":"https://api.github.com/users/jat255/followers","following_url":"https://api.github.com/users/jat255/following{/other_user}","gists_url":"https://api.github.com/users/jat255/gists{/gist_id}","starred_url":"https://api.github.com/users/jat255/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jat255/subscriptions","organizations_url":"https://api.github.com/users/jat255/orgs","repos_url":"https://api.github.com/users/jat255/repos","events_url":"https://api.github.com/users/jat255/events{/privacy}","received_events_url":"https://api.github.com/users/jat255/received_events","type":"User","site_admin":false},"repo":{"id":28409375,"name":"hyperspy","full_name":"jat255/hyperspy","owner":{"login":"jat255","id":1278301,"avatar_url":"https://avatars.githubusercontent.com/u/1278301?v=3","gravatar_id":"","url":"https://api.github.com/users/jat255","html_url":"https://github.com/jat255","followers_url":"https://api.github.com/users/jat255/followers","following_url":"https://api.github.com/users/jat255/following{/other_user}","gists_url":"https://api.github.com/users/jat255/gists{/gist_id}","starred_url":"https://api.github.com/users/jat255/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jat255/subscriptions","organizations_url":"https://api.github.com/users/jat255/orgs","repos_url":"https://api.github.com/users/jat255/repos","events_url":"https://api.github.com/users/jat255/events{/privacy}","received_events_url":"https://api.github.com/users/jat255/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jat255/hyperspy","description":"Multidimensional data analysis","fork":true,"url":"https://api.github.com/repos/jat255/hyperspy","forks_url":"https://api.github.com/repos/jat255/hyperspy/forks","keys_url":"https://api.github.com/repos/jat255/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jat255/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jat255/hyperspy/teams","hooks_url":"https://api.github.com/repos/jat255/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/jat255/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/jat255/hyperspy/events","assignees_url":"https://api.github.com/repos/jat255/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/jat255/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/jat255/hyperspy/tags","blobs_url":"https://api.github.com/repos/jat255/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jat255/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jat255/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jat255/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jat255/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/jat255/hyperspy/languages","stargazers_url":"https://api.github.com/repos/jat255/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/jat255/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/jat255/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/jat255/hyperspy/subscription","commits_url":"https://api.github.com/repos/jat255/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jat255/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jat255/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jat255/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jat255/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/jat255/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jat255/hyperspy/merges","archive_url":"https://api.github.com/repos/jat255/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jat255/hyperspy/downloads","issues_url":"https://api.github.com/repos/jat255/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/jat255/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/jat255/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/jat255/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jat255/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/jat255/hyperspy/releases{/id}","created_at":"2014-12-23T16:59:02Z","updated_at":"2015-04-01T17:15:22Z","pushed_at":"2015-04-01T18:12:49Z","git_url":"git://github.com/jat255/hyperspy.git","ssh_url":"git@github.com:jat255/hyperspy.git","clone_url":"https://github.com/jat255/hyperspy.git","svn_url":"https://github.com/jat255/hyperspy","homepage":"http://www.hyperspy.org","size":66917,"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":"hyperspy:master","ref":"master","sha":"b090e608fc953b2242334e0819a78e5fa06aa900","user":{"login":"hyperspy","id":989756,"avatar_url":"https://avatars.githubusercontent.com/u/989756?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperspy","html_url":"https://github.com/hyperspy","followers_url":"https://api.github.com/users/hyperspy/followers","following_url":"https://api.github.com/users/hyperspy/following{/other_user}","gists_url":"https://api.github.com/users/hyperspy/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperspy/subscriptions","organizations_url":"https://api.github.com/users/hyperspy/orgs","repos_url":"https://api.github.com/users/hyperspy/repos","events_url":"https://api.github.com/users/hyperspy/events{/privacy}","received_events_url":"https://api.github.com/users/hyperspy/received_events","type":"Organization","site_admin":false},"repo":{"id":2233998,"name":"hyperspy","full_name":"hyperspy/hyperspy","owner":{"login":"hyperspy","id":989756,"avatar_url":"https://avatars.githubusercontent.com/u/989756?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperspy","html_url":"https://github.com/hyperspy","followers_url":"https://api.github.com/users/hyperspy/followers","following_url":"https://api.github.com/users/hyperspy/following{/other_user}","gists_url":"https://api.github.com/users/hyperspy/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperspy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperspy/subscriptions","organizations_url":"https://api.github.com/users/hyperspy/orgs","repos_url":"https://api.github.com/users/hyperspy/repos","events_url":"https://api.github.com/users/hyperspy/events{/privacy}","received_events_url":"https://api.github.com/users/hyperspy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperspy/hyperspy","description":"Multidimensional data analysis","fork":false,"url":"https://api.github.com/repos/hyperspy/hyperspy","forks_url":"https://api.github.com/repos/hyperspy/hyperspy/forks","keys_url":"https://api.github.com/repos/hyperspy/hyperspy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperspy/hyperspy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperspy/hyperspy/teams","hooks_url":"https://api.github.com/repos/hyperspy/hyperspy/hooks","issue_events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/events{/number}","events_url":"https://api.github.com/repos/hyperspy/hyperspy/events","assignees_url":"https://api.github.com/repos/hyperspy/hyperspy/assignees{/user}","branches_url":"https://api.github.com/repos/hyperspy/hyperspy/branches{/branch}","tags_url":"https://api.github.com/repos/hyperspy/hyperspy/tags","blobs_url":"https://api.github.com/repos/hyperspy/hyperspy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperspy/hyperspy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperspy/hyperspy/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperspy/hyperspy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperspy/hyperspy/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperspy/hyperspy/languages","stargazers_url":"https://api.github.com/repos/hyperspy/hyperspy/stargazers","contributors_url":"https://api.github.com/repos/hyperspy/hyperspy/contributors","subscribers_url":"https://api.github.com/repos/hyperspy/hyperspy/subscribers","subscription_url":"https://api.github.com/repos/hyperspy/hyperspy/subscription","commits_url":"https://api.github.com/repos/hyperspy/hyperspy/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperspy/hyperspy/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperspy/hyperspy/contents/{+path}","compare_url":"https://api.github.com/repos/hyperspy/hyperspy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperspy/hyperspy/merges","archive_url":"https://api.github.com/repos/hyperspy/hyperspy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperspy/hyperspy/downloads","issues_url":"https://api.github.com/repos/hyperspy/hyperspy/issues{/number}","pulls_url":"https://api.github.com/repos/hyperspy/hyperspy/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperspy/hyperspy/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperspy/hyperspy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/labels{/name}","releases_url":"https://api.github.com/repos/hyperspy/hyperspy/releases{/id}","created_at":"2011-08-19T13:14:36Z","updated_at":"2015-04-06T11:08:32Z","pushed_at":"2015-04-06T11:17:29Z","git_url":"git://github.com/hyperspy/hyperspy.git","ssh_url":"git@github.com:hyperspy/hyperspy.git","clone_url":"https://github.com/hyperspy/hyperspy.git","svn_url":"https://github.com/hyperspy/hyperspy","homepage":"http://www.hyperspy.org","size":75078,"stargazers_count":36,"watchers_count":36,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":91,"forks":22,"open_issues":91,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454"},"html":{"href":"https://github.com/hyperspy/hyperspy/pull/454"},"issue":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/454"},"comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/issues/454/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454/commits"},"statuses":{"href":"https://api.github.com/repos/hyperspy/hyperspy/statuses/0b240868c0655463b79b0612b67e0af732926f12"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"pburdet","id":3855190,"avatar_url":"https://avatars.githubusercontent.com/u/3855190?v=3","gravatar_id":"","url":"https://api.github.com/users/pburdet","html_url":"https://github.com/pburdet","followers_url":"https://api.github.com/users/pburdet/followers","following_url":"https://api.github.com/users/pburdet/following{/other_user}","gists_url":"https://api.github.com/users/pburdet/gists{/gist_id}","starred_url":"https://api.github.com/users/pburdet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pburdet/subscriptions","organizations_url":"https://api.github.com/users/pburdet/orgs","repos_url":"https://api.github.com/users/pburdet/repos","events_url":"https://api.github.com/users/pburdet/events{/privacy}","received_events_url":"https://api.github.com/users/pburdet/received_events","type":"User","site_admin":false},"comments":64,"review_comments":19,"commits":67,"additions":1038,"deletions":17,"changed_files":14}}