def test_distribution_plot(artworks_df, artworks_summary): def mock_render(fig): # check that this draws a histogram assert len(fig.axes[0].patches) > 0 explorer = Explorer(artworks_summary, plot_renderer=mock_render) explorer.distribution_plot("Height (cm)")
def test_distribution_plot_bins(artworks_df, artworks_summary): Nbins = 13 def mock_render(fig): # check that this draws a histogram with Nbins bars assert len(fig.axes[0].patches) == Nbins explorer = Explorer(artworks_summary, plot_renderer=mock_render) explorer.distribution_plot("Height (cm)", bins=Nbins)