code: def test_mosaic_simple(close_figures):
      # display a simple plot of 4 categories of data, splitted in four
      # levels with increasing size for each group
      # creation of the levels
      key_set = (
          ["male", "female"],
          ["old", "adult", "young"],
          ["worker", "unemployed"],
          ["healty", "ill"],
      )
      # the cartesian product of all the categories is
      # the complete set of categories
      keys = list(product(*key_set))
      data = dict(zip(keys, range(1, 1 + len(keys))))
      # which colours should I use for the various categories?
      # put it into a dict
      props = {}
      # males and females in blue and red
      props[("male",)] = {"color": "b"}
      props[("female",)] = {"color": "r"}
      # all the groups corresponding to ill groups have a different color
      for key in keys:
          if "ill" in key:
              if "male" in key:
                  props[key] = {"color": "BlueViolet", "hatch": "+"}
              else:
                  props[key] = {"color": "Crimson", "hatch": "+"}
      # mosaic of the data, with given gaps and colors
      mosaic(data, gap=0.05, properties=props, axes_label=False)
      plt.suptitle("syntetic data, 4 categories (plot 2 of 4)")
  
imports: from statsmodels.compat.python import lrange
  from io import BytesIO
  from itertools import product
  import numpy
  from numpy.testing import assert_, assert_raises
  import pandas
  import pytest
  from statsmodels.api import datasets
  from statsmodels.graphics.mosaicplot import _hierarchical_split, _key_splitting, _normalize_split, _reduce_dict, _split_rect, mosaic
label_desc: Use image node_id 2 for calling a global function with example usage: test_mosaic_simple(close_figures) without return types