diff --git a/datascience/tables.py b/datascience/tables.py index a8341ef39..fe9730da6 100644 --- a/datascience/tables.py +++ b/datascience/tables.py @@ -1311,22 +1311,26 @@ def to_array(self): 'alpha': 0.8, } - def plot(self, column_for_xticks=None, overlay=False, **vargs): + def plot(self, column_for_xticks, overlay=False, **vargs): """Plot contents as lines.""" options = self.default_options.copy() options.update(vargs) + + # Note that the labels here get incorrectly placed on the x-axis even + # though the labels describe the y-axis values. + # TODO(sam): Allow _visualize to accept options to put labels on both x + # and y axes. xticks, labels = self._split_by_column(column_for_xticks) def draw(axis, label, color): if xticks is None: axis.plot(self[label], color=color, **options) - else : + else: axis.plot(xticks, self[label], color=color, **options) def annotate(axis, ticks): - tick_labels = [ticks[int(l)] for l in axis.get_xticks() if l