Skip to content

Commit

Permalink
Retain the argument colors= for now, for backwards compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwagner committed Jun 22, 2019
1 parent 0570ebd commit ce59e65
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions datascience/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,8 @@ def group_barh(self, column_label, **vargs):
self.group(column_label).barh(column_label, **vargs)

def scatter(self, column_for_x, select=None, overlay=True, fit_line=False,
group=None, labels=None, sizes=None, width=5, height=5, s=20, **vargs):
group=None, labels=None, sizes=None, width=5, height=5, s=20,
Colors=None, **vargs):
"""Creates scatterplots, optionally adding a line of best fit.
Args:
Expand All @@ -2314,7 +2315,10 @@ def scatter(self, column_for_x, select=None, overlay=True, fit_line=False,
``sizes``: A column of values to set the relative areas of dots.
``s``: Size of dots. If sizes is also provided, then dots will be
in the range 0 to 2 * s.
in the range 0 to 2 * s.
``colors``: (deprecated) A synonym for ``group``. Retained
for backwards compatibility.
Raises:
ValueError -- Every column, ``column_for_x`` or ``select``, must be numerical
Expand Down Expand Up @@ -2351,6 +2355,14 @@ def scatter(self, column_for_x, select=None, overlay=True, fit_line=False,
options.update(vargs)

x_data, y_labels = self._split_column_and_labels(column_for_x)
if group is not None and colors is not None and group != colors:
warnings.warn("Do not pass both colors and group to scatter().")
if group is None and colors is not None:
# Backward compatibility
group = colors
# TODO: In a future release, warn that this is deprecated.
# Deprecated
# warnings.warn("scatter(colors=x) is deprecated. Use scatter(group=x)", FutureWarning)
if group is not None:
y_labels.remove(self._as_label(group))
if sizes is not None:
Expand Down

0 comments on commit ce59e65

Please sign in to comment.