{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/152009396","pull_request_review_id":77803605,"id":152009396,"diff_hunk":"@@ -1529,162 +1689,204 @@ def plot_compare_evokeds(evokeds, picks=list(), gfp=False, colors=None,\n     invert_y : bool\n         If True, negative values are plotted up (as is sometimes done\n         for ERPs out of tradition). Defaults to False.\n-    show_sensors: bool | int | None\n+    show_sensors: bool | int | str | None\n         If not False, channel locations are plotted on a small head circle.\n-        If an int, the position of the axes (forwarded to\n+        If int or str, the position of the axes (forwarded to\n         ``mpl_toolkits.axes_grid1.inset_locator.inset_axes``).\n         If None, defaults to True if ``gfp`` is False, else to False.\n-    show_legend : bool | int\n-        If not False, show a legend. If int, the position of the axes\n-        (forwarded to ``mpl_toolkits.axes_grid1.inset_locator.inset_axes``).\n+    show_legend : bool | str | int\n+        If not False, show a legend. If int or str, it is the position of the\n+        legend axes (forwarded to\n+        ``mpl_toolkits.axes_grid1.inset_locator.inset_axes``).\n+    split_legend : bool\n+        If True, the legend shows color and linestyle separately; `colors` must\n+        not be None. Defaults to True if ``cmap`` is not None, else defaults to\n+        False.\n     axes : None | `matplotlib.axes.Axes` instance | list of `axes`\n         What axes to plot to. If None, a new axes is created.\n         When plotting multiple channel types, can also be a list of axes, one\n         per channel type.\n     title : None | str\n-        If str, will be plotted as figure title. If None, the channel\n-        names will be shown.\n+        If str, will be plotted as figure title. If None, the channel names\n+        will be shown.\n     show : bool\n         If True, show the figure.\n \n     Returns\n     -------\n     fig : Figure | list of Figures\n-        The figure(s) in which the plot is drawn.\n+        The figure(s) in which the plot is drawn. When plotting multiple\n+        channel types, a list of figures, one for each channel type is\n+        returned.\n+\n+    Notes\n+    -----\n+    When multiple channels are passed, this function combines them all, to\n+    get one time course for each condition. If gfp is True it combines\n+    channels using global field power (GFP) computation, else it is taking\n+    a plain mean.\n+\n+    This function is useful for comparing multiple ER[P/F]s - e.g., for\n+    multiple conditions - at a specific location.\n+\n+    It can plot:\n+\n+        - a simple :class:`mne.Evoked` object,\n+        - a list or dict of :class:`mne.Evoked` objects (e.g., for multiple\n+          conditions),\n+        - a list or dict of lists of :class:`mne.Evoked` (e.g., for multiple\n+          subjects in multiple conditions).\n+\n+    In the last case, it can show a confidence interval (across e.g. subjects)\n+    using parametric or bootstrap estimation.\n+\n+    When ``picks`` includes more than one planar gradiometer, the planar\n+    gradiometers are combined with RMSE. For example data from a\n+    VectorView system with 204 gradiometers will be transformed to\n+    102 channels.\n     \"\"\"\n     import matplotlib.pyplot as plt\n-    from ..evoked import Evoked, combine_evoked\n \n-    # set up labels and instances\n-    if isinstance(evokeds, Evoked):\n-        evokeds = dict(Evoked=evokeds)  # title becomes 'Evoked'\n-    elif not isinstance(evokeds, dict):\n-        evokeds = dict((str(ii + 1), evoked)\n-                       for ii, evoked in enumerate(evokeds))\n-    for cond in evokeds.keys():\n-        if not isinstance(cond, string_types):\n-            raise TypeError('Conditions must be str, not %s' % (type(cond),))\n+    evokeds, colors = _format_evokeds_colors(evokeds, cmap, colors)\n     conditions = sorted(list(evokeds.keys()))\n \n+    # check ci parameter\n+    if ci is None:\n+        ci = False\n+    if ci is True:\n+        ci = .95\n+    elif ci is not False and not (isinstance(ci, np.float) or callable(ci)):\n+        raise TypeError('ci must be None, bool, float or callable, got %s' %\n+                        type(ci))\n+\n     # get and set a few limits and variables (times, channels, units)\n-    example = (evokeds[conditions[0]]\n-               if isinstance(evokeds[conditions[0]], Evoked)\n-               else evokeds[conditions[0]][0])\n-    if not isinstance(example, Evoked):\n-        raise ValueError(\"evokeds must be an instance of mne.Evoked \"\n-                         \"or a collection of mne.Evoked's\")\n-    times = example.times\n+    one_evoked = evokeds[conditions[0]][0]\n+    times = one_evoked.times\n+    info = one_evoked.info\n+    ch_names = one_evoked.ch_names\n     tmin, tmax = times[0], times[-1]\n-    if (tmin >= 0 or tmax <= 0) and vlines == [0.]:\n-        vlines = list()\n+\n+    if vlines is \"auto\" and (tmin < 0 and tmax > 0):\n+        vlines = [0.]\n+    assert isinstance(vlines, list)","path":"mne/viz/evoked.py","position":379,"original_position":379,"commit_id":"dbfd361cbac14685e1e47834d3bfd38d8702686a","original_commit_id":"dbfd361cbac14685e1e47834d3bfd38d8702686a","user":{"login":"larsoner","id":2365790,"avatar_url":"https://avatars1.githubusercontent.com/u/2365790?v=4","gravatar_id":"","url":"https://api.github.com/users/larsoner","html_url":"https://github.com/larsoner","followers_url":"https://api.github.com/users/larsoner/followers","following_url":"https://api.github.com/users/larsoner/following{/other_user}","gists_url":"https://api.github.com/users/larsoner/gists{/gist_id}","starred_url":"https://api.github.com/users/larsoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsoner/subscriptions","organizations_url":"https://api.github.com/users/larsoner/orgs","repos_url":"https://api.github.com/users/larsoner/repos","events_url":"https://api.github.com/users/larsoner/events{/privacy}","received_events_url":"https://api.github.com/users/larsoner/received_events","type":"User","site_admin":false},"body":"From the code above I don't think you've validated that it should be a `list` at this point, so this should be a full `if not isinstance(vlines, (list, tuple)): raise TypeError(...)`","created_at":"2017-11-20T14:47:24Z","updated_at":"2017-11-20T14:52:58Z","html_url":"https://github.com/mne-tools/mne-python/pull/4755#discussion_r152009396","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/152009396"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/4755#discussion_r152009396"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755","id":152686516,"html_url":"https://github.com/mne-tools/mne-python/pull/4755","diff_url":"https://github.com/mne-tools/mne-python/pull/4755.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/4755.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/4755","number":4755,"state":"open","locked":false,"title":"[MRG] Fix compare evokeds","user":{"login":"agramfort","id":161052,"avatar_url":"https://avatars2.githubusercontent.com/u/161052?v=4","gravatar_id":"","url":"https://api.github.com/users/agramfort","html_url":"https://github.com/agramfort","followers_url":"https://api.github.com/users/agramfort/followers","following_url":"https://api.github.com/users/agramfort/following{/other_user}","gists_url":"https://api.github.com/users/agramfort/gists{/gist_id}","starred_url":"https://api.github.com/users/agramfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agramfort/subscriptions","organizations_url":"https://api.github.com/users/agramfort/orgs","repos_url":"https://api.github.com/users/agramfort/repos","events_url":"https://api.github.com/users/agramfort/events{/privacy}","received_events_url":"https://api.github.com/users/agramfort/received_events","type":"User","site_admin":false},"body":"closes #4736 and #4526\r\n\r\n@jona-sassenhagen @ktavabi I took over both of your PRs and simplify to refactor / simplify\r\n\r\nplease have a look","created_at":"2017-11-15T05:14:09Z","updated_at":"2017-11-20T14:52:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a820c56ad589753680476dd01eb2af2adf7c3046","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755/comments","review_comment_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/4755/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/dbfd361cbac14685e1e47834d3bfd38d8702686a","head":{"label":"agramfort:fix-compare-evokeds","ref":"fix-compare-evokeds","sha":"dbfd361cbac14685e1e47834d3bfd38d8702686a","user":{"login":"agramfort","id":161052,"avatar_url":"https://avatars2.githubusercontent.com/u/161052?v=4","gravatar_id":"","url":"https://api.github.com/users/agramfort","html_url":"https://github.com/agramfort","followers_url":"https://api.github.com/users/agramfort/followers","following_url":"https://api.github.com/users/agramfort/following{/other_user}","gists_url":"https://api.github.com/users/agramfort/gists{/gist_id}","starred_url":"https://api.github.com/users/agramfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agramfort/subscriptions","organizations_url":"https://api.github.com/users/agramfort/orgs","repos_url":"https://api.github.com/users/agramfort/repos","events_url":"https://api.github.com/users/agramfort/events{/privacy}","received_events_url":"https://api.github.com/users/agramfort/received_events","type":"User","site_admin":false},"repo":{"id":2202093,"name":"mne-python","full_name":"agramfort/mne-python","owner":{"login":"agramfort","id":161052,"avatar_url":"https://avatars2.githubusercontent.com/u/161052?v=4","gravatar_id":"","url":"https://api.github.com/users/agramfort","html_url":"https://github.com/agramfort","followers_url":"https://api.github.com/users/agramfort/followers","following_url":"https://api.github.com/users/agramfort/following{/other_user}","gists_url":"https://api.github.com/users/agramfort/gists{/gist_id}","starred_url":"https://api.github.com/users/agramfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agramfort/subscriptions","organizations_url":"https://api.github.com/users/agramfort/orgs","repos_url":"https://api.github.com/users/agramfort/repos","events_url":"https://api.github.com/users/agramfort/events{/privacy}","received_events_url":"https://api.github.com/users/agramfort/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agramfort/mne-python","description":"MNE scripting with Python","fork":true,"url":"https://api.github.com/repos/agramfort/mne-python","forks_url":"https://api.github.com/repos/agramfort/mne-python/forks","keys_url":"https://api.github.com/repos/agramfort/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agramfort/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agramfort/mne-python/teams","hooks_url":"https://api.github.com/repos/agramfort/mne-python/hooks","issue_events_url":"https://api.github.com/repos/agramfort/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/agramfort/mne-python/events","assignees_url":"https://api.github.com/repos/agramfort/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/agramfort/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/agramfort/mne-python/tags","blobs_url":"https://api.github.com/repos/agramfort/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agramfort/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agramfort/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/agramfort/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agramfort/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/agramfort/mne-python/languages","stargazers_url":"https://api.github.com/repos/agramfort/mne-python/stargazers","contributors_url":"https://api.github.com/repos/agramfort/mne-python/contributors","subscribers_url":"https://api.github.com/repos/agramfort/mne-python/subscribers","subscription_url":"https://api.github.com/repos/agramfort/mne-python/subscription","commits_url":"https://api.github.com/repos/agramfort/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/agramfort/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/agramfort/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/agramfort/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/agramfort/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/agramfort/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agramfort/mne-python/merges","archive_url":"https://api.github.com/repos/agramfort/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agramfort/mne-python/downloads","issues_url":"https://api.github.com/repos/agramfort/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/agramfort/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/agramfort/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/agramfort/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agramfort/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/agramfort/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/agramfort/mne-python/deployments","created_at":"2011-08-13T15:44:42Z","updated_at":"2017-09-21T17:44:28Z","pushed_at":"2017-11-18T13:34:49Z","git_url":"git://github.com/agramfort/mne-python.git","ssh_url":"git@github.com:agramfort/mne-python.git","clone_url":"https://github.com/agramfort/mne-python.git","svn_url":"https://github.com/agramfort/mne-python","homepage":"http://martinos.org/mne","size":97879,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"086478e8334b38fbe02be4c0f2a147429906ba4a","user":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars3.githubusercontent.com/u/583875?v=4","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"repo":{"id":1301584,"name":"mne-python","full_name":"mne-tools/mne-python","owner":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars3.githubusercontent.com/u/583875?v=4","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mne-tools/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":false,"url":"https://api.github.com/repos/mne-tools/mne-python","forks_url":"https://api.github.com/repos/mne-tools/mne-python/forks","keys_url":"https://api.github.com/repos/mne-tools/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mne-tools/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mne-tools/mne-python/teams","hooks_url":"https://api.github.com/repos/mne-tools/mne-python/hooks","issue_events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/mne-tools/mne-python/events","assignees_url":"https://api.github.com/repos/mne-tools/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/mne-tools/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/mne-tools/mne-python/tags","blobs_url":"https://api.github.com/repos/mne-tools/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mne-tools/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mne-tools/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mne-tools/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mne-tools/mne-python/languages","stargazers_url":"https://api.github.com/repos/mne-tools/mne-python/stargazers","contributors_url":"https://api.github.com/repos/mne-tools/mne-python/contributors","subscribers_url":"https://api.github.com/repos/mne-tools/mne-python/subscribers","subscription_url":"https://api.github.com/repos/mne-tools/mne-python/subscription","commits_url":"https://api.github.com/repos/mne-tools/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mne-tools/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mne-tools/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/mne-tools/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mne-tools/mne-python/merges","archive_url":"https://api.github.com/repos/mne-tools/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mne-tools/mne-python/downloads","issues_url":"https://api.github.com/repos/mne-tools/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/mne-tools/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mne-tools/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mne-tools/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mne-tools/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/mne-tools/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/mne-tools/mne-python/deployments","created_at":"2011-01-28T03:31:13Z","updated_at":"2017-11-14T20:25:16Z","pushed_at":"2017-11-20T13:26:34Z","git_url":"git://github.com/mne-tools/mne-python.git","ssh_url":"git@github.com:mne-tools/mne-python.git","clone_url":"https://github.com/mne-tools/mne-python.git","svn_url":"https://github.com/mne-tools/mne-python","homepage":"http://martinos.org/mne/","size":97132,"stargazers_count":358,"watchers_count":358,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":328,"mirror_url":null,"archived":false,"open_issues_count":221,"forks":328,"open_issues":221,"watchers":358,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/4755"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/4755"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/4755/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755/comments"},"review_comment":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/4755/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/dbfd361cbac14685e1e47834d3bfd38d8702686a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"larsoner"}}