Repository: mne-tools/mne-python

Issue:
(bug?) The `brain_color` parameter of `plot_dipole_locations` seems unused
@Eric89GXL: what's up with the `brain_color` and `mesh_color` parameters of the `plot_dipole_locations` function? The former doesn't seem to be used. It seems to be copied from `plot_sparse_source_estimates`, where it is used to set the color of the glass mesh. In this function, the `mesh_color` parameter is used for this. Perhaps we should deprecate `mesh_color` and use `brain_color` in both functions?



Discussion:
here brain is "inner skull" right?

yes, `bem/inner_skull.surf`

Yeah that looks like a bug to me, good call

do you agree with the resolution proposed in this PR?

I think it's actually okay not even to deprecate because it was unused and a bug to have it in the first place. Also I doubt this particular function is heavily used.

yes just remove. it's a bug fix.

good catch @wmvanvliet 

closing in favor of #2798


Resolving patch:
diff --git a/mne/dipole.py b/mne/dipole.py
--- a/mne/dipole.py
+++ b/mne/dipole.py
@@ -118,8 +118,8 @@ def copy(self):
     @verbose
     def plot_locations(self, trans, subject, subjects_dir=None,
                        bgcolor=(1, 1, 1), opacity=0.3,
-                       brain_color=(0.7, 0.7, 0.7), mesh_color=(1, 1, 0),
-                       fig_name=None, fig_size=(600, 600), mode='cone',
+                       brain_color=(1, 1, 0), fig_name=None,
+                       fig_size=(600, 600), mode='cone',
                        scale_factor=0.1e-1, colors=None, verbose=None):
         """Plot dipole locations as arrows
 
@@ -140,8 +140,6 @@ def plot_locations(self, trans, subject, subjects_dir=None,
             Opacity of brain mesh.
         brain_color : tuple of length 3
             Brain color.
-        mesh_color : tuple of length 3
-            Mesh color.
         fig_name : tuple of length 2
             Mayavi figure name.
         fig_size : tuple of length 2
@@ -168,7 +166,7 @@ def plot_locations(self, trans, subject, subjects_dir=None,
             dipoles[-1].crop(t, t)
         return plot_dipole_locations(
             dipoles, trans, subject, subjects_dir, bgcolor, opacity,
-            brain_color, mesh_color, fig_name, fig_size, mode, scale_factor,
+            brain_color, fig_name, fig_size, mode, scale_factor,
             colors)
 
     def plot_amplitudes(self, color='k', show=True):
diff --git a/mne/viz/_3d.py b/mne/viz/_3d.py
--- a/mne/viz/_3d.py
+++ b/mne/viz/_3d.py
@@ -829,8 +829,8 @@ def plot_sparse_source_estimates(src, stcs, colors=None, linewidth=2,
 
 def plot_dipole_locations(dipoles, trans, subject, subjects_dir=None,
                           bgcolor=(1, 1, 1), opacity=0.3,
-                          brain_color=(0.7, 0.7, 0.7), mesh_color=(1, 1, 0),
-                          fig_name=None, fig_size=(600, 600), mode='cone',
+                          brain_color=(1, 1, 0), fig_name=None,
+                          fig_size=(600, 600), mode='cone',
                           scale_factor=0.1e-1, colors=None, verbose=None):
     """Plot dipole locations
 
@@ -855,8 +855,6 @@ def plot_dipole_locations(dipoles, trans, subject, subjects_dir=None,
         Opacity of brain mesh.
     brain_color : tuple of length 3
         Brain color.
-    mesh_color : tuple of length 3
-        Mesh color.
     fig_name : str
         Mayavi figure name.
     fig_size : tuple of length 2
@@ -904,7 +902,7 @@ def plot_dipole_locations(dipoles, trans, subject, subjects_dir=None,
     fig = mlab.figure(size=fig_size, bgcolor=bgcolor, fgcolor=(0, 0, 0))
     with warnings.catch_warnings(record=True):  # FutureWarning in traits
         mlab.triangular_mesh(points[:, 0], points[:, 1], points[:, 2],
-                             faces, color=mesh_color, opacity=opacity)
+                             faces, color=brain_color, opacity=opacity)
 
     for dip, color in zip(dipoles, colors):
         rgb_color = color_converter.to_rgb(color)


Test patch: