def _init_axes(self, data, method='<STR_LIT>',<EOL>xscale=None, sharex=False, sharey=False,<EOL>geometry=None, separate=None, **kwargs):
if isinstance(sharex, bool):<EOL><INDENT>sharex = "<STR_LIT:all>" if sharex else "<STR_LIT:none>"<EOL><DEDENT>if isinstance(sharey, bool):<EOL><INDENT>sharey = "<STR_LIT:all>" if sharey else "<STR_LIT:none>"<EOL><DEDENT>axes_kw = {key: kwargs.pop(key) for key in utils.AXES_PARAMS if<EOL>key in kwargs}<EOL>if geometry is not None and geometry[<NUM_LIT:0>] * geometry[<NUM_LIT:1>] == len(data):<EOL><INDENT>separate = True<EOL><DEDENT>axes_groups = _group_axes_data(data, separate=separate)<EOL>if geometry is None:<EOL><INDENT>geometry = (len(axes_groups), <NUM_LIT:1>)<EOL><DEDENT>nrows, ncols = geometry<EOL>if axes_groups and nrows * ncols != len(axes_groups):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(len(axes_groups), nrows,<EOL>ncols))<EOL><DEDENT>gs = GridSpec(nrows, ncols)<EOL>axarr = numpy.empty((nrows, ncols), dtype=object)<EOL>defxlabel = '<STR_LIT>' not in axes_kw<EOL>defylabel = '<STR_LIT>' not in axes_kw<EOL>flatdata = [s for group in axes_groups for s in group]<EOL>for axis in ('<STR_LIT:x>', '<STR_LIT:y>'):<EOL><INDENT>unit = _common_axis_unit(flatdata, axis=axis)<EOL>if unit:<EOL><INDENT>axes_kw.setdefault('<STR_LIT>'.format(axis),<EOL>unit.to_string('<STR_LIT>'))<EOL><DEDENT><DEDENT>for group, (row, col) in zip_longest(<EOL>axes_groups, itertools.product(range(nrows), range(ncols)),<EOL>fillvalue=[]):<EOL><INDENT>shared_with = {"<STR_LIT:none>": None, "<STR_LIT:all>": axarr[<NUM_LIT:0>, <NUM_LIT:0>],<EOL>"<STR_LIT>": axarr[row, <NUM_LIT:0>], "<STR_LIT>": axarr[<NUM_LIT:0>, col]}<EOL>axes_kw["<STR_LIT>"] = shared_with[sharex]<EOL>axes_kw["<STR_LIT>"] = shared_with[sharey]<EOL>axes_kw['<STR_LIT>'] = xscale if xscale else _parse_xscale(group)<EOL>ax = axarr[row, col] = self.add_subplot(gs[row, col], **axes_kw)<EOL>plot_func = getattr(ax, method)<EOL>if method in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>for obj in group:<EOL><INDENT>plot_func(obj, **kwargs)<EOL><DEDENT><DEDENT>elif group:<EOL><INDENT>plot_func(*group, **kwargs)<EOL><DEDENT>for axis, share, pos, n, def_ in (<EOL>(ax.xaxis, sharex, row, nrows, defxlabel),<EOL>(ax.yaxis, sharey, col, ncols, defylabel),<EOL>):<EOL><INDENT>if share == '<STR_LIT:all>' and pos < n - <NUM_LIT:1>:<EOL><INDENT>axis.set_label_text('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>axis.isDefault_label = def_<EOL><DEDENT><DEDENT><DEDENT>return self.axes<EOL>
Populate this figure with data, creating `Axes` as necessary