Skip to content

VIS: let scatter plots obey mpl color scheme (#3338) #5060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pandas/tools/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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]
Expand Down Expand Up @@ -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:]
Expand Down Expand Up @@ -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
Expand Down