From f9031c21b2efb50047684182fbcb0b95dc50af99 Mon Sep 17 00:00:00 2001 From: cel4 Date: Wed, 4 Feb 2015 23:23:10 +0100 Subject: [PATCH] improved error messages for invalid chart types --- pandas/tools/plotting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py index 2d7976d567108..fd3db3f5eef8e 100644 --- a/pandas/tools/plotting.py +++ b/pandas/tools/plotting.py @@ -2266,7 +2266,7 @@ def _plot(data, x=None, y=None, subplots=False, if kind in _all_kinds: klass = _plot_klass[kind] else: - raise ValueError('Invalid chart type given %s' % kind) + raise ValueError("%r is not a valid plot kind" % kind) from pandas import DataFrame if kind in _dataframe_kinds: @@ -2274,7 +2274,8 @@ def _plot(data, x=None, y=None, subplots=False, plot_obj = klass(data, x=x, y=y, subplots=subplots, ax=ax, kind=kind, **kwds) else: - raise ValueError('Invalid chart type given %s' % kind) + raise ValueError("plot kind %r can only be used for data frames" + % kind) elif kind in _series_kinds: if isinstance(data, DataFrame):