Skip to content

Commit 92707b9

Browse files
committed
Merge pull request #6822 from cpcloud/no-random-hist-by-test
TST/BUG: make the gender variable non random in test_hist_by_no_extra_plots
2 parents 886e30b + e79058d commit 92707b9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pandas/tests/test_graphics.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_plot_fails_with_dupe_color_and_style(self):
182182
def test_hist_by_no_extra_plots(self):
183183
import matplotlib.pyplot as plt
184184
n = 10
185-
df = DataFrame({'gender': tm.choice(['Male', 'Female'], size=n),
185+
df = DataFrame({'gender': ['Male'] * 5 + ['Female'] * 5,
186186
'height': random.normal(66, 4, size=n)})
187187
axes = df.height.hist(by=df.gender)
188188
self.assertEqual(len(plt.get_fignums()), 1)
@@ -593,9 +593,9 @@ def test_bar_linewidth(self):
593593
@slow
594594
def test_bar_barwidth(self):
595595
df = DataFrame(randn(5, 5))
596-
596+
597597
width = 0.9
598-
598+
599599
# regular
600600
ax = df.plot(kind='bar', width=width)
601601
for r in ax.patches:
@@ -681,7 +681,7 @@ def _check_bar_alignment(self, df, kind='bar', stacked=False,
681681
align=align, width=width, position=position,
682682
grid=True)
683683

684-
tick_pos = np.arange(len(df))
684+
tick_pos = np.arange(len(df))
685685

686686
if not isinstance(axes, np.ndarray):
687687
axes = [axes]
@@ -780,7 +780,7 @@ def test_bar_subplots_center(self):
780780
self.assertEqual(ax.get_xlim(), (-0.5, 4.75))
781781

782782
self._check_bar_alignment(df, kind='bar', subplots=True, width=0.9)
783-
783+
784784
axes = self._check_bar_alignment(df, kind='barh', subplots=True)
785785
for ax in axes:
786786
self.assertEqual(ax.get_ylim(), (-0.5, 4.75))

pandas/tools/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
221221
either Kernel Density Estimation or Histogram
222222
plot in the diagonal
223223
marker : str, optional
224-
Matplotlib marker type, default '.'
224+
Matplotlib marker type, default '.'
225225
hist_kwds : other plotting keyword arguments
226226
To be passed to hist function
227227
density_kwds : other plotting keyword arguments
@@ -1678,7 +1678,7 @@ def __init__(self, data, **kwargs):
16781678

16791679
kwargs['align'] = kwargs.pop('align', 'center')
16801680
self.tick_pos = np.arange(len(data))
1681-
1681+
16821682
self.log = kwargs.pop('log',False)
16831683
MPLPlot.__init__(self, data, **kwargs)
16841684

0 commit comments

Comments
 (0)