def _gen_figure(nxplot=<NUM_LIT:1>, nyplot=<NUM_LIT:1>, figargs=None, projection=None,<EOL>sharex='<STR_LIT:none>', joinx=False, sharey='<STR_LIT:none>', joiny=False,<EOL>x=None, nxlabel=None, xlabels=None, nxdecimal=None, xmin=None, xmax=None,<EOL>y=None, nylabel=None, ylabels=None, nydecimal=None, ymin=None, ymax=None,<EOL>z=None, nzlabel=None, zlabels=None, nzdecimal=None, zmin=None, zmax=None,<EOL>r=None, nrlabel=None, rlabels=None, nrdecimal=None, rmin=None, rmax=None,<EOL>t=None, ntlabel=None, tlabels=None, fontsize=<NUM_LIT:20>):
figargs = {} if figargs is None else figargs<EOL>if projection is not None:<EOL><INDENT>fig, axs = _gen_projected(nxplot, nyplot, projection, figargs)<EOL><DEDENT>else:<EOL><INDENT>fig, axs = _gen_shared(nxplot, nyplot, sharex, sharey, figargs)<EOL><DEDENT>adj = {}<EOL>if joinx: adj.update({'<STR_LIT>': <NUM_LIT:0>})<EOL>if joiny: adj.update({'<STR_LIT>': <NUM_LIT:0>})<EOL>fig.subplots_adjust(**adj)<EOL>data = {}<EOL>if projection is None:<EOL><INDENT>data = {'<STR_LIT:x>': x, '<STR_LIT:y>': y}<EOL><DEDENT>elif projection == '<STR_LIT>':<EOL><INDENT>data = {'<STR_LIT:x>': x, '<STR_LIT:y>': y, '<STR_LIT:z>': z}<EOL><DEDENT>elif projection == '<STR_LIT>':<EOL><INDENT>data = {'<STR_LIT:r>': r, '<STR_LIT:t>': t}<EOL><DEDENT>methods = {}<EOL>for ax in axs:<EOL><INDENT>if '<STR_LIT:x>' in data:<EOL><INDENT>methods['<STR_LIT:x>'] = (ax.set_xlim, ax.set_xticks, ax.set_xticklabels,<EOL>nxlabel, xlabels, nxdecimal, xmin, xmax)<EOL><DEDENT>if '<STR_LIT:y>' in data:<EOL><INDENT>methods['<STR_LIT:y>'] = (ax.set_ylim, ax.set_yticks, ax.set_yticklabels,<EOL>nylabel, ylabels, nydecimal, ymin, ymax)<EOL><DEDENT>if '<STR_LIT:z>' in data:<EOL><INDENT>methods['<STR_LIT:z>'] = (ax.set_zlim, ax.set_zticks, ax.set_zticklabels,<EOL>nzlabel, zlabels, nzdecimal, zmin, zmax)<EOL><DEDENT>if '<STR_LIT:r>' in data:<EOL><INDENT>methods['<STR_LIT:r>'] = (ax.set_rlim, ax.set_rticks, ax.set_rgrids,<EOL>nrlabel, rlabels, nrdecimal, rmin, rmax)<EOL><DEDENT>if '<STR_LIT:t>' in data:<EOL><INDENT>methods['<STR_LIT:t>'] = (ax.set_thetagrids, ntlabel, tlabels)<EOL><DEDENT>for dim, arr in data.items():<EOL><INDENT>if dim == '<STR_LIT:t>':<EOL><INDENT>grids, nlabel, labls = methods[dim]<EOL>if ntlabel is not None:<EOL><INDENT>theta = np.arange(<NUM_LIT:0>, <NUM_LIT:2> * np.pi, <NUM_LIT:2> * np.pi / ntlabel)<EOL>if labls is not None:<EOL><INDENT>grids(np.degrees(theta), labls, fontsize=fontsize)<EOL><DEDENT>else:<EOL><INDENT>grids(np.degrees(theta), fontsize=fontsize)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>lim, ticks, labels, nlabel, labls, decs, mins, maxs = methods[dim]<EOL>if arr is not None:<EOL><INDENT>amin = mins if mins is not None else arr.min()<EOL>amax = maxs if maxs is not None else arr.max()<EOL>lim((amin, amax))<EOL><DEDENT>elif mins is not None and maxs is not None:<EOL><INDENT>if nlabel is not None:<EOL><INDENT>ticks(np.linspace(amin, amax, nlabel))<EOL>if decs is not None:<EOL><INDENT>sub = "<STR_LIT>".format(decs).format<EOL>labels([sub(i) for i in np.linspace(amin, amax, nlabel)])<EOL><DEDENT><DEDENT><DEDENT>if labls is not None:<EOL><INDENT>labels(labls)<EOL><DEDENT>ax.tick_params(axis=dim, labelsize=fontsize)<EOL><DEDENT><DEDENT><DEDENT>return fig<EOL>
Returns a figure object with as much customization as provided.