code: def test_groupby_hist_frame_with_legend(
      self, column, expected_axes_num
  ):
      # GH 6279 - DataFrameGroupBy histogram can have a legend
      expected_layout = (1, expected_axes_num)
      expected_labels = column or [["a"], ["b"]]
  
      index = Index(15 * ["1"] + 15 * ["2"], name="c")
      df = DataFrame(
          np.random.default_rng(2).standard_normal((30, 2)),
          index=index,
          columns=["a", "b"],
      )
      g = df.groupby("c")
  
      for axes in g.hist(legend=True, column=column):
          _check_axes_shape(
              axes, axes_num=expected_axes_num, layout=expected_layout
          )
          for ax, expected_label in zip(axes[0], expected_labels):
              _check_legend_labels(ax, expected_label)
  
file_path: pandas/pandas/tests/plotting/test_groupby.py
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, Series
  from pandas.tests.plotting.common import _check_axes_shape, _check_legend_labels
label_desc: Use image node_id 12 for calling the TestDataFrameGroupByPlots obj's underlying member method code with example usage: obj.test_groupby_hist_frame_with_legend(column, expected_axes_num) without return types