code
stringlengths
3
6.57k
self._check_axes_shape(axes, axes_num=4, layout=(1, 4)
tm.assert_produces_warning(UserWarning)
_check_plot_works(df.height.hist, by=df.classroom, layout=(2, 2)
self._check_axes_shape(axes, axes_num=3, layout=(2, 2)
df.height.hist(by=df.category, layout=(4, 2)
self._check_axes_shape(axes, axes_num=4, layout=(4, 2)
test_hist_no_overlap(self)
Series(np.random.randn(2)
Series(np.random.randn(2)
subplot(121)
x.hist()
subplot(122)
y.hist()
gcf()
len(axes)
test_hist_by_no_extra_plots(self)
df.height.hist(by=df.gender)
len(self.plt.get_fignums()
test_plot_fails_when_ax_differs_from_figure(self)
figure()
figure()
fig1.add_subplot(111)
pytest.raises(AssertionError)
self.ts.hist(ax=ax1, figure=fig2)
test_histtype_argument(self, histtype, expected)
Series(np.random.randint(1, 10)
ser.hist(histtype=histtype)
self._check_patches_all_filled(ax, filled=expected)
test_hist_with_legend(self, by, expected_axes_num, expected_layout)
Series(np.random.randn(30)
_check_plot_works(s.hist, default_axes=True, legend=True, by=by)
self._check_axes_shape(axes, axes_num=expected_axes_num, layout=expected_layout)
self._check_legend_labels(axes, "a")
pytest.mark.parametrize("by", [None, "b"])
test_hist_with_legend_raises(self, by)
Series(np.random.randn(30)
pytest.raises(ValueError, match="Cannot use both legend and label")
s.hist(legend=True, by=by, label="c")
TestDataFramePlots(TestPlotBase)
test_hist_df_legacy(self)
tm.assert_produces_warning(UserWarning)
_check_plot_works(self.hist_df.hist)
DataFrame(np.random.randn(100, 2)
tm.assert_produces_warning(UserWarning)
_check_plot_works(df.hist, grid=False)
self._check_axes_shape(axes, axes_num=3, layout=(2, 2)
get_visible()
_check_plot_works(df[[2]].hist)
DataFrame(np.random.randn(100, 1)
_check_plot_works(df.hist)
DataFrame(np.random.randn(100, 5)
tm.assert_produces_warning(UserWarning)
_check_plot_works(df.hist, layout=(4, 2)
self._check_axes_shape(axes, axes_num=6, layout=(4, 2)
tm.assert_produces_warning(UserWarning)
_check_plot_works(df.hist, sharex=True, sharey=True)
tm.assert_produces_warning(UserWarning)
_check_plot_works(df.hist, figsize=(8, 10)
tm.assert_produces_warning(UserWarning)
_check_plot_works(df.hist, bins=5)
ser.hist(xlabelsize=xf, xrot=xrot, ylabelsize=yf, yrot=yrot)
df.hist(xlabelsize=xf, xrot=xrot, ylabelsize=yf, yrot=yrot)
tm.close()
ser.hist(cumulative=True, bins=4, density=True)
bin (index 5)
ax.get_children()
isinstance(x, Rectangle)
tm.assert_almost_equal(rects[-1].get_height()
tm.close()
ser.hist(log=True)
self._check_ax_scales(ax, yaxis="log")
tm.close()
pytest.raises(AttributeError)
ser.hist(foo="bar")
test_hist_non_numerical_or_datetime_raises(self)
np.random.rand(10)
np.random.randint(0, 10, 10)
df.astype(object)
pytest.raises(ValueError, match=msg)
df_o.hist()
test_hist_layout(self)
DataFrame(np.random.randn(100, 2)
df.hist(layout=layout_test["layout"])
self._check_axes_shape(axes, axes_num=3, layout=expected)
pytest.raises(ValueError)
df.hist(layout=(1, 1)
pytest.raises(ValueError)
df.hist(layout=(1,)
pytest.raises(ValueError)
df.hist(layout=(-1, -1)
test_tight_layout(self)
DataFrame(np.random.randn(100, 2)
_check_plot_works(df.hist, default_axes=True)
self.plt.tight_layout()
tm.close()
test_hist_subplot_xrot(self)
self._check_ticks_props(axes, xrot=0)
test_hist_column_order_unchanged(self, column, expected)
get_title()
range(3)