9
9
import numpy as np
10
10
from numpy .random import randn
11
11
12
- import pandas .plotting as plotting
12
+ from pandas .plotting . _core import grouped_hist
13
13
from pandas .tests .plotting .common import (TestPlotBase , _check_plot_works )
14
14
15
15
@@ -260,7 +260,7 @@ def test_grouped_hist_legacy(self):
260
260
df ['C' ] = np .random .randint (0 , 4 , 500 )
261
261
df ['D' ] = ['X' ] * 500
262
262
263
- axes = plotting . grouped_hist (df .A , by = df .C )
263
+ axes = grouped_hist (df .A , by = df .C )
264
264
self ._check_axes_shape (axes , axes_num = 4 , layout = (2 , 2 ))
265
265
266
266
tm .close ()
@@ -277,10 +277,9 @@ def test_grouped_hist_legacy(self):
277
277
# make sure kwargs to hist are handled
278
278
xf , yf = 20 , 18
279
279
xrot , yrot = 30 , 40
280
- axes = plotting .grouped_hist (df .A , by = df .C , normed = True ,
281
- cumulative = True , bins = 4 ,
282
- xlabelsize = xf , xrot = xrot ,
283
- ylabelsize = yf , yrot = yrot )
280
+ axes = grouped_hist (df .A , by = df .C , normed = True , cumulative = True ,
281
+ bins = 4 , xlabelsize = xf , xrot = xrot ,
282
+ ylabelsize = yf , yrot = yrot )
284
283
# height of last bin (index 5) must be 1.0
285
284
for ax in axes .ravel ():
286
285
rects = [x for x in ax .get_children () if isinstance (x , Rectangle )]
@@ -290,14 +289,14 @@ def test_grouped_hist_legacy(self):
290
289
ylabelsize = yf , yrot = yrot )
291
290
292
291
tm .close ()
293
- axes = plotting . grouped_hist (df .A , by = df .C , log = True )
292
+ axes = grouped_hist (df .A , by = df .C , log = True )
294
293
# scale of y must be 'log'
295
294
self ._check_ax_scales (axes , yaxis = 'log' )
296
295
297
296
tm .close ()
298
297
# propagate attr exception from matplotlib.Axes.hist
299
298
with tm .assertRaises (AttributeError ):
300
- plotting . grouped_hist (df .A , by = df .C , foo = 'bar' )
299
+ grouped_hist (df .A , by = df .C , foo = 'bar' )
301
300
302
301
with tm .assert_produces_warning (FutureWarning ):
303
302
df .hist (by = 'C' , figsize = 'default' )
0 commit comments