Skip to content

Commit d4bdb0a

Browse files
remaining feedback + reorg
1 parent c6452b3 commit d4bdb0a

25 files changed

+95
-106
lines changed

pandas/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
# deprecate tools.plotting, plot_params and scatter_matrix on the top namespace
5454
import pandas.tools.plotting
55-
plot_params = pandas.plotting.style._Options(deprecated=True)
55+
plot_params = pandas.plotting._style._Options(deprecated=True)
5656
# do not import deprecate to top namespace
5757
scatter_matrix = pandas.util.decorators.deprecate(
5858
'pandas.scatter_matrix', pandas.plotting.scatter_matrix,

pandas/core/config_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def mpl_style_cb(key):
285285
stacklevel=5)
286286

287287
import sys
288-
from pandas.plotting.style import mpl_stylesheet
288+
from pandas.plotting._style import mpl_stylesheet
289289
global style_backup
290290

291291
val = cf.get_option(key)

pandas/core/frame.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
import pandas.core.ops as ops
9191
import pandas.formats.format as fmt
9292
from pandas.formats.printing import pprint_thing
93-
import pandas.plotting.core as gfx
93+
import pandas.plotting._core as gfx
9494

9595
from pandas._libs import lib, algos as libalgos
9696

@@ -5909,11 +5909,11 @@ def _put_str(s, space):
59095909
@Appender(_shared_docs['boxplot'] % _shared_doc_kwargs)
59105910
def boxplot(self, column=None, by=None, ax=None, fontsize=None, rot=0,
59115911
grid=True, figsize=None, layout=None, return_type=None, **kwds):
5912-
import pandas.plotting as plots
5912+
from pandas.plotting._core import boxplot
59135913
import matplotlib.pyplot as plt
5914-
ax = plots.boxplot(self, column=column, by=by, ax=ax, fontsize=fontsize,
5915-
grid=grid, rot=rot, figsize=figsize, layout=layout,
5916-
return_type=return_type, **kwds)
5914+
ax = boxplot(self, column=column, by=by, ax=ax, fontsize=fontsize,
5915+
grid=grid, rot=rot, figsize=figsize, layout=layout,
5916+
return_type=return_type, **kwds)
59175917
plt.draw_if_interactive()
59185918
return ax
59195919

pandas/core/groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4159,7 +4159,7 @@ def groupby_series(obj, col=None):
41594159
return results
41604160

41614161

4162-
from pandas.plotting.core import boxplot_frame_groupby # noqa
4162+
from pandas.plotting._core import boxplot_frame_groupby # noqa
41634163
DataFrameGroupBy.boxplot = boxplot_frame_groupby
41644164

41654165

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ def create_from_value(value, index, dtype):
30013001
# ----------------------------------------------------------------------
30023002
# Add plotting methods to Series
30033003

3004-
import pandas.plotting.core as _gfx # noqa
3004+
import pandas.plotting._core as _gfx # noqa
30053005

30063006
Series.plot = base.AccessorProperty(_gfx.SeriesPlotMethods,
30073007
_gfx.SeriesPlotMethods)

pandas/plotting/__init__.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
from pandas.plotting.api import * # noqa
1+
"""
2+
Plotting api
3+
"""
4+
5+
# flake8: noqa
6+
7+
try: # mpl optional
8+
from pandas.plotting import _converter
9+
_converter.register() # needs to override so set_xlim works with str/number
10+
except ImportError:
11+
pass
12+
13+
from pandas.plotting._misc import (scatter_matrix, radviz,
14+
andrews_curves, bootstrap_plot,
15+
parallel_coordinates, lag_plot,
16+
autocorrelation_plot)
17+
from pandas.plotting._core import boxplot
18+
from pandas.plotting._style import plot_params
19+
from pandas.plotting._tools import table
File renamed without changes.
File renamed without changes.

pandas/plotting/core.py renamed to pandas/plotting/_core.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
from pandas.formats.printing import pprint_thing
2727
from pandas.util.decorators import Appender
2828

29-
from pandas.plotting.compat import (_mpl_ge_1_3_1,
30-
_mpl_ge_1_5_0)
31-
from pandas.plotting.style import (mpl_stylesheet, plot_params,
32-
_get_standard_colors)
33-
from pandas.plotting.tools import (_subplots, _flatten, table,
34-
_handle_shared_axes, _get_all_lines,
35-
_get_xlim, _set_ticks_props,
36-
format_date_labels)
29+
from pandas.plotting._compat import (_mpl_ge_1_3_1,
30+
_mpl_ge_1_5_0)
31+
from pandas.plotting._style import (mpl_stylesheet, plot_params,
32+
_get_standard_colors)
33+
from pandas.plotting._tools import (_subplots, _flatten, table,
34+
_handle_shared_axes, _get_all_lines,
35+
_get_xlim, _set_ticks_props,
36+
format_date_labels)
3737

3838

3939
if _mpl_ge_1_5_0():
@@ -900,12 +900,12 @@ def _is_ts_plot(self):
900900
return not self.x_compat and self.use_index and self._use_dynamic_x()
901901

902902
def _use_dynamic_x(self):
903-
from pandas.plotting.timeseries import _use_dynamic_x
903+
from pandas.plotting._timeseries import _use_dynamic_x
904904
return _use_dynamic_x(self._get_ax(0), self.data)
905905

906906
def _make_plot(self):
907907
if self._is_ts_plot():
908-
from pandas.plotting.timeseries import _maybe_convert_index
908+
from pandas.plotting._timeseries import _maybe_convert_index
909909
data = _maybe_convert_index(self._get_ax(0), self.data)
910910

911911
x = data.index # dummy, not used
@@ -955,9 +955,9 @@ def _plot(cls, ax, x, y, style=None, column_num=None,
955955

956956
@classmethod
957957
def _ts_plot(cls, ax, x, data, style=None, **kwds):
958-
from pandas.plotting.timeseries import (_maybe_resample,
959-
_decorate_axes,
960-
format_dateaxis)
958+
from pandas.plotting._timeseries import (_maybe_resample,
959+
_decorate_axes,
960+
format_dateaxis)
961961
# accept x to be consistent with normal plot func,
962962
# x is not passed to tsplot as it uses data.index as x coordinate
963963
# column_num must be in kwds for stacking purpose

pandas/plotting/misc.py renamed to pandas/plotting/_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from pandas.formats.printing import pprint_thing
1111

1212

13-
from pandas.plotting.style import _get_standard_colors
14-
from pandas.plotting.tools import _subplots, _set_ticks_props
13+
from pandas.plotting._style import _get_standard_colors
14+
from pandas.plotting._tools import _subplots, _set_ticks_props
1515

1616

1717
def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,

0 commit comments

Comments
 (0)