{"action":"created","issue":{"url":"https://api.github.com/repos/mne-tools/mne-python/issues/2253","repository_url":"https://api.github.com/repos/mne-tools/mne-python","labels_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2253/labels{/name}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2253/comments","events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2253/events","html_url":"https://github.com/mne-tools/mne-python/issues/2253","id":92190815,"number":2253,"title":"Channel type auto scalings in plot","user":{"login":"choldgraf","id":1839645,"avatar_url":"https://avatars.githubusercontent.com/u/1839645?v=3","gravatar_id":"","url":"https://api.github.com/users/choldgraf","html_url":"https://github.com/choldgraf","followers_url":"https://api.github.com/users/choldgraf/followers","following_url":"https://api.github.com/users/choldgraf/following{/other_user}","gists_url":"https://api.github.com/users/choldgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/choldgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choldgraf/subscriptions","organizations_url":"https://api.github.com/users/choldgraf/orgs","repos_url":"https://api.github.com/users/choldgraf/repos","events_url":"https://api.github.com/users/choldgraf/events{/privacy}","received_events_url":"https://api.github.com/users/choldgraf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-30T20:24:41Z","updated_at":"2016-04-29T18:04:26Z","closed_at":"2016-04-27T17:32:08Z","body":"Maybe it's just an ecog thing, but my data are often at a very different scale than the MNE defaults during calls to plot. Usually I just do something like `scalings={'eeg': data._data.max() / 2}` or something. However, would it be useful to just allow a string to be passed to \"scalings\" that would automatically do this? E.g.:\r\n\r\n```python\r\nif scalings == 'auto':\r\n  ch_types = [mne.io.pick.channel_type(data.info, i) for i in range(len(data.ch_names))]\r\n  scalings = {}\r\n  for type in set(ch_types):\r\n    picks = data.pick_types({type: True})  # Would also need to set MEG to false if this isn't a meg chan\r\n    scalings[type] = picks.max() / 2\r\n```\r\n\r\nThis could either be allowed as a function to plot commands, or perhaps a more convenient way of implementing this without changing API stuff too much is to just implement a create_channel_scalings function. e.g.:\r\n\r\n```python\r\ndef create_channel_scalings(data, scale_func=np.max, scale_factor=1):\r\n  ch_types = [mne.io.pick.channel_type(data.info, i) for i in range(len(data.ch_names))]\r\n  scalings = {}\r\n  for type in set(ch_types):\r\n    picks = data.pick_types({type: True})  # Is there a better way to pick channel types?\r\n    scalings[type] = scale_func(picks) / scale_factor\r\n  return scalings\r\n```\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments/215832246","html_url":"https://github.com/mne-tools/mne-python/issues/2253#issuecomment-215832246","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2253","id":215832246,"user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T18:04:26Z","updated_at":"2016-04-29T18:04:26Z","body":"As long as it's not the default, and documented clearly in the docstring it's okay with me. I suspect the implementation for `Raw` and `Epochs`, which can be non-preloaded, will be non-trivial from a memory-saving standpoint."}}