{"action":"created","issue":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454","labels_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454/comments","events_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454/events","html_url":"https://github.com/hyperspy/hyperspy/pull/454","id":55924910,"number":454,"title":"ENH: 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},"labels":[{"url":"https://api.github.com/repos/hyperspy/hyperspy/labels/New","name":"New","color":"f7c6c7"}],"state":"open","locked":false,"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":38,"closed_issues":53,"state":"open","created_at":"2014-04-01T11:09:41Z","updated_at":"2015-03-04T17:54:42Z","due_on":"2015-03-26T00:00:00Z","closed_at":null},"comments":14,"created_at":"2015-01-29T16:50:41Z","updated_at":"2015-03-05T23:07:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hyperspy/hyperspy/pulls/454","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"},"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\nTODO:\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~~ --- *The way this is implemented now, the color bar is in a fixed position on the right side, and it doesn't really \"fit\" with the figures when resizing (regarding spacing and such). Any suggestions are welcome.* \r\n- [x] ~~Plot scale bar option~~\r\n- [x] ~~Plot axes option~~ --- *As currently implemented, this also disables the frame around the image. I suppose this is personal preference, but should it be included?*\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- [ ] implement padding option to control spacing between images\r\n- [ ] Investigate switching to GridSpec for layout?\r\n- [ ] implement single option for `colorbar` (`None, 'default', or 'single'`)\r\n- [ ] one option for `axes` (`None, 'default' (which is ticks and labels), 'ticks' (no labels)`)\r\n- [ ] refactor `plot_scalebar` as `scalebar` (`None, 'all', or list of `int` choosing which plots should have the scalebar`)\r\n- [ ] Fix colorbar placement\r\n- [ ] Documentation in user guide "},"comment":{"url":"https://api.github.com/repos/hyperspy/hyperspy/issues/comments/77472285","html_url":"https://github.com/hyperspy/hyperspy/pull/454#issuecomment-77472285","issue_url":"https://api.github.com/repos/hyperspy/hyperspy/issues/454","id":77472285,"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},"created_at":"2015-03-05T23:07:10Z","updated_at":"2015-03-05T23:07:10Z","body":"Sorry for the long delay on getting back working on this. I'm having some trouble using tight_layout. One problem seems to be that if the titles for each image are long, and overlap significantly, tight_layout bombs the whole figure and doesn't give an error as to what happened. (I think this is what was happening in @pburdet https://github.com/hyperspy/hyperspy/pull/454#issuecomment-72194135) As such, I can't figure out how to fix it. \r\n\r\nI guess a bad (but perhaps necessary) solution would be to warn the user if titles are long/overlapping, either in the documentation or with a message at runtime. Does anyone have experience with this issue?"}}