Repository: pandas-dev/pandas

Issue:
Go over the rest of the plotting functions so they obey the mpl color scheme
continuing #3112 , get rid of all the shocking blue in [visualization.rst](http://pandas.pydata.org/pandas-docs/dev/visualization.html)

scatter_plot still uses the evil blue, for one.
Also, grid defaults.



Discussion:
@cpcloud if you are interested

or maybe cc @jorisvandenbossche as you seem to like these kinds of things!

I think the only remaining 'evil blues' on [visualisation.html](http://pandas.pydata.org/pandas-docs/dev/visualization.html) are for `scatter_matrix` and `lag_plot`. They both use the `scatter` method from matplotlib. Some observations:
- The reason is because `c='b'` is hardcoded in the matplotlib scatter function (see [here](https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L3140)), and thus not following the color in the settings (rcParams['patch.facecolor']). So changing this settings does not affect the scatter plot.
- I think this can be seen as a bug/inconvenience in matplotlib => maybe issue there
- We could try to circumvent this in pandas:
  - explicitly set color or facecolor equal to to `matplotlib.rcParams['patch.facecolor']`
  - however, I don't directly see how to do that without getting into problems when the user also sets a color in the functions (`scatter_matrix(..., c= ..)` because this is then leads to 'keyword argument repeated'

Ah, for the last point, I suppose we could simply check if the user included `c` in de `**kwds`, and then using that color.

@jorisvandenbossche sounds like a job for `dict.setdefault`!

also we should use `color` and not `c`

@jtratner you mean just `kwds.setdefault('c', matplotlib.rcParams['patch.facecolor'])`?

@cpcloud Would you add a `color` keyword? Because at the moment, there is no color keyword in [`scatter_matrix`](https://github.com/pydata/pandas/blob/master/pandas/tools/plotting.py#L203). If you want to change the color of the markers, you just have to use the passing of `c` to the matplotlib `scatter` via `**kwds`. 
But that's a seperate issue I think, because als eg `bootstrap_plot`, `lag_plot`, `autocorrelation_plot`, have no `color` keyword, but it depends on the underlying matplotlib function if setting `color` would work or not.

@jorisvandenbossche `c` or `color` is accepted by `scatter`, it's actually already "there" since `kwds` is passed to `scatter`, so you can use either `c` or `color` when you're calling `scatter_matrix`. The problem is that you break that "feature" of calling `scatter` if you choose either `c` or `color` so you need to account for the case where someone would pass both (pathological, but possible). I would enforce the `color` keyword parameter.

@cpcloud Ah, OK, I didn't know that you could use `color` in scatter (not really clear from the docstring or code).

Isn't it then enough to just check both and set to default value if necessary? 'color' is already given preference by matplotlib if both are specified

```
kwds.setdefault('c', matplotlib.rcParams['patch.facecolor'])
kwds.setdefault('color', matplotlib.rcParams['patch.facecolor'])
```

@jorisvandenbossche is this still an issue?

@jreback yes it still is, but I think it is an easy fix (if what i said above is true), I will do a PR.


Resolving patch:
diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py
--- a/pandas/tools/plotting.py
+++ b/pandas/tools/plotting.py
@@ -229,6 +229,7 @@ def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
     >>> df = DataFrame(np.random.randn(1000, 4), columns=['A','B','C','D'])
     >>> scatter_matrix(df, alpha=0.2)
     """
+    import matplotlib.pyplot as plt
     from matplotlib.artist import setp
 
     df = frame._get_numeric_data()
@@ -246,6 +247,9 @@ def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
     hist_kwds = hist_kwds or {}
     density_kwds = density_kwds or {}
 
+    # workaround because `c='b'` is hardcoded in matplotlibs scatter method
+    kwds.setdefault('c', plt.rcParams['patch.facecolor'])
+
     for i, a in zip(lrange(n), df.columns):
         for j, b in zip(lrange(n), df.columns):
             ax = axes[i, j]
@@ -653,6 +657,10 @@ def lag_plot(series, lag=1, ax=None, **kwds):
     ax: Matplotlib axis object
     """
     import matplotlib.pyplot as plt
+    
+    # workaround because `c='b'` is hardcoded in matplotlibs scatter method
+    kwds.setdefault('c', plt.rcParams['patch.facecolor'])
+    
     data = series.values
     y1 = data[:-lag]
     y2 = data[lag:]
@@ -1889,6 +1897,9 @@ def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False, **kwarg
     """
     import matplotlib.pyplot as plt
 
+    # workaround because `c='b'` is hardcoded in matplotlibs scatter method
+    kwargs.setdefault('c', plt.rcParams['patch.facecolor'])
+
     def plot_group(group, ax):
         xvals = group[x].values
         yvals = group[y].values


Test patch: