def _make_phased_magseries_plot(axes,<EOL>periodind,<EOL>stimes, smags, serrs,<EOL>varperiod, varepoch,<EOL>phasewrap, phasesort,<EOL>phasebin, minbinelems,<EOL>plotxlim,<EOL>lspmethod,<EOL>lspmethodind=<NUM_LIT:0>,<EOL>xliminsetmode=False,<EOL>twolspmode=False,<EOL>magsarefluxes=False,<EOL>verbose=True,<EOL>phasems=<NUM_LIT>,<EOL>phasebinms=<NUM_LIT>):
plotvarepoch = None<EOL>if varepoch is None:<EOL><INDENT>plotvarepoch = npmin(stimes)<EOL><DEDENT>elif isinstance(varepoch, str) and varepoch == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>spfit = spline_fit_magseries(stimes,<EOL>smags,<EOL>serrs,<EOL>varperiod,<EOL>magsarefluxes=magsarefluxes,<EOL>sigclip=None,<EOL>verbose=verbose)<EOL>plotvarepoch = spfit['<STR_LIT>']['<STR_LIT>']<EOL>if len(plotvarepoch) != <NUM_LIT:1>:<EOL><INDENT>plotvarepoch = varepoch[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>LOGERROR('<STR_LIT>')<EOL>sgfit = savgol_fit_magseries(stimes,<EOL>smags,<EOL>serrs,<EOL>varperiod,<EOL>sigclip=None,<EOL>magsarefluxes=magsarefluxes,<EOL>verbose=verbose)<EOL>plotvarepoch = sgfit['<STR_LIT>']['<STR_LIT>']<EOL>if len(plotvarepoch) != <NUM_LIT:1>:<EOL><INDENT>plotvarepoch = plotvarepoch[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>if plotvarepoch is None:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>plotvarepoch = npmin(stimes)<EOL><DEDENT><DEDENT><DEDENT>elif isinstance(varepoch, list):<EOL><INDENT>try:<EOL><INDENT>if twolspmode:<EOL><INDENT>thisvarepochlist = varepoch[lspmethodind]<EOL>plotvarepoch = thisvarepochlist[periodind]<EOL><DEDENT>else:<EOL><INDENT>plotvarepoch = varepoch[periodind]<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>LOGEXCEPTION(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>plotvarepoch = npmin(stimes)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>plotvarepoch = varepoch<EOL><DEDENT>if verbose:<EOL><INDENT>LOGINFO('<STR_LIT>' %<EOL>(varperiod, plotvarepoch))<EOL><DEDENT>phasedlc = phase_magseries(stimes,<EOL>smags,<EOL>varperiod,<EOL>plotvarepoch,<EOL>wrap=phasewrap,<EOL>sort=phasesort)<EOL>plotphase = phasedlc['<STR_LIT>']<EOL>plotmags = phasedlc['<STR_LIT>']<EOL>if phasebin:<EOL><INDENT>binphasedlc = phase_bin_magseries(plotphase,<EOL>plotmags,<EOL>binsize=phasebin,<EOL>minbinelems=minbinelems)<EOL>binplotphase = binphasedlc['<STR_LIT>']<EOL>binplotmags = binphasedlc['<STR_LIT>']<EOL><DEDENT>axes.plot(plotphase,<EOL>plotmags,<EOL>marker='<STR_LIT:o>',<EOL>ms=phasems, ls='<STR_LIT:None>',mew=<NUM_LIT:0>,<EOL>color='<STR_LIT>',<EOL>rasterized=True)<EOL>if phasebin:<EOL><INDENT>axes.plot(binplotphase,<EOL>binplotmags,<EOL>marker='<STR_LIT:o>',<EOL>ms=phasebinms, ls='<STR_LIT:None>',mew=<NUM_LIT:0>,<EOL>color='<STR_LIT>',<EOL>rasterized=True)<EOL><DEDENT>if not magsarefluxes:<EOL><INDENT>plot_ylim = axes.get_ylim()<EOL>axes.set_ylim((plot_ylim[<NUM_LIT:1>], plot_ylim[<NUM_LIT:0>]))<EOL><DEDENT>if not plotxlim:<EOL><INDENT>axes.set_xlim((npmin(plotphase)-<NUM_LIT:0.1>,<EOL>npmax(plotphase)+<NUM_LIT:0.1>))<EOL><DEDENT>else:<EOL><INDENT>axes.set_xlim((plotxlim[<NUM_LIT:0>],plotxlim[<NUM_LIT:1>]))<EOL><DEDENT>axes.grid(color='<STR_LIT>',<EOL>alpha=<NUM_LIT>,<EOL>zorder=<NUM_LIT:0>,<EOL>linewidth=<NUM_LIT:1.0>,<EOL>linestyle='<STR_LIT::>')<EOL>plot_xlabel = '<STR_LIT>'<EOL>if magsarefluxes:<EOL><INDENT>plot_ylabel = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>plot_ylabel = '<STR_LIT>'<EOL><DEDENT>axes.set_xlabel(plot_xlabel)<EOL>axes.set_ylabel(plot_ylabel)<EOL>axes.get_yaxis().get_major_formatter().set_useOffset(False)<EOL>axes.get_xaxis().get_major_formatter().set_useOffset(False)<EOL>if periodind == <NUM_LIT:0>:<EOL><INDENT>plottitle = '<STR_LIT>' % (<EOL>METHODSHORTLABELS[lspmethod],<EOL>varperiod,<EOL>plotvarepoch<EOL>)<EOL><DEDENT>elif periodind == <NUM_LIT:1> and not twolspmode:<EOL><INDENT>plottitle = '<STR_LIT>' % (<EOL>METHODSHORTLABELS[lspmethod],<EOL>varperiod,<EOL>plotvarepoch<EOL>)<EOL><DEDENT>elif periodind == <NUM_LIT:2> and not twolspmode:<EOL><INDENT>plottitle = '<STR_LIT>' % (<EOL>METHODSHORTLABELS[lspmethod],<EOL>varperiod,<EOL>plotvarepoch<EOL>)<EOL><DEDENT>elif periodind > <NUM_LIT:2> and not twolspmode:<EOL><INDENT>plottitle = '<STR_LIT>' % (<EOL>METHODSHORTLABELS[lspmethod],<EOL>periodind-<NUM_LIT:1>,<EOL>varperiod,<EOL>plotvarepoch<EOL>)<EOL><DEDENT>elif periodind > <NUM_LIT:0>:<EOL><INDENT>plottitle = '<STR_LIT>' % (<EOL>METHODSHORTLABELS[lspmethod],<EOL>periodind+<NUM_LIT:1>,<EOL>varperiod,<EOL>plotvarepoch<EOL>)<EOL><DEDENT>axes.set_title(plottitle)<EOL>if (plotxlim and isinstance(plotxlim, (list,tuple)) and<EOL>len(plotxlim) == <NUM_LIT:2> and xliminsetmode is True):<EOL><INDENT>axesylim = axes.get_ylim()<EOL>if magsarefluxes:<EOL><INDENT>axes.set_ylim(axesylim[<NUM_LIT:0>],<EOL>axesylim[<NUM_LIT:1>] + <NUM_LIT:0.5>*npabs(axesylim[<NUM_LIT:1>]-axesylim[<NUM_LIT:0>]))<EOL><DEDENT>else:<EOL><INDENT>axes.set_ylim(axesylim[<NUM_LIT:0>],<EOL>axesylim[<NUM_LIT:1>] - <NUM_LIT:0.5>*npabs(axesylim[<NUM_LIT:1>]-axesylim[<NUM_LIT:0>]))<EOL><DEDENT>inset = inset_axes(axes, width="<STR_LIT>", height="<STR_LIT>", loc=<NUM_LIT:1>)<EOL>inset.plot(plotphase,<EOL>plotmags,<EOL>marker='<STR_LIT:o>',<EOL>ms=<NUM_LIT>, ls='<STR_LIT:None>',mew=<NUM_LIT:0>,<EOL>color='<STR_LIT>',<EOL>rasterized=True)<EOL>if phasebin:<EOL><INDENT>inset.plot(binplotphase,<EOL>binplotmags,<EOL>marker='<STR_LIT:o>',<EOL>ms=<NUM_LIT>, ls='<STR_LIT:None>',mew=<NUM_LIT:0>,<EOL>color='<STR_LIT>',<EOL>rasterized=True)<EOL><DEDENT>if phasewrap:<EOL><INDENT>inset.set_xlim(-<NUM_LIT>,<NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>inset.set_xlim(-<NUM_LIT:0.1>,<NUM_LIT>)<EOL><DEDENT>if not magsarefluxes:<EOL><INDENT>inset_ylim = inset.get_ylim()<EOL>inset.set_ylim((inset_ylim[<NUM_LIT:1>], inset_ylim[<NUM_LIT:0>]))<EOL><DEDENT>inset.text(<NUM_LIT:0.5>,<NUM_LIT:0.1>,'<STR_LIT>',<EOL>ha='<STR_LIT>',va='<STR_LIT>',transform=inset.transAxes)<EOL>inset.set_xticks([])<EOL>inset.set_yticks([])<EOL><DEDENT>
Makes the phased magseries plot tile for the `checkplot_png` and
    `twolsp_checkplot_png` functions.

    Parameters
    ----------

    axes : matplotlib.axes.Axes object
        The Axes object where the generated plot will be written.

    periodind : int
        The index of the current best period being processed in the lspinfo
        dict.

    stimes,smags,serrs : np.array
        The mag/flux time-series arrays along with associated errors. These
        should all have been run through nan-stripping and sigma-clipping
        beforehand.

    varperiod : float or None
        The period to use for this phased light curve plot tile.

    varepoch : 'min' or float or list of lists or None
        The epoch to use for this phased light curve plot tile. If this is a
        float, will use the provided value directly. If this is 'min', will
        automatically figure out the time-of-minimum of the phased light
        curve. If this is None, will use the mimimum value of `stimes` as the
        epoch of the phased light curve plot. If this is a list of lists, will
        use the provided value of `lspmethodind` to look up the current
        period-finder method and the provided value of `periodind` to look up
        the epoch associated with that method and the current period. This is
        mostly only useful when `twolspmode` is True.

    phasewrap : bool
        If this is True, the phased time-series will be wrapped around
        phase 0.0.

    phasesort : bool
        If True, will sort the phased light curve in order of increasing phase.

    phasebin: float
        The bin size to use to group together measurements closer than this
        amount in phase. This is in units of phase. If this is a float, a
        phase-binned version of the phased light curve will be overplotted on
        top of the regular phased light curve.

    minbinelems : int
        The minimum number of elements required per phase bin to include it in
        the phased LC plot.

    plotxlim : sequence of two floats or None
        The x-range (min, max) of the phased light curve plot. If None, will be
        determined automatically.

    lspmethod : str
        One of the three-letter keys corresponding to period-finder method names
        in the `astrobase.plotbase.METHODSHORTLABELS` dict. Used to set the plot
        title correctly.

    lspmethodind : int
        If `twolspmode` is set, this will be used to look up the correct epoch
        associated with the current period-finder method and period.

    xliminsetmode : bool
        If this is True, the generated phased light curve plot will use the
        values of `plotxlim` as the main plot x-axis limits (i.e. zoomed-in if
        `plotxlim` is a range smaller than the full phase range), and will show
        the full phased light curve plot as an smaller inset. Useful for
        planetary transit light curves.

    twolspmode : bool
        If this is True, will use the `lspmethodind` and `periodind` to look up
        the correct values of epoch, etc. in the provided `varepoch` list of
        lists for plotting purposes.

    magsarefluxes : bool
        If True, indicates the input time-series is fluxes and not mags so the
        plot y-axis direction and range can be set appropriately.

    verbose : bool
        If True, indicates progress.

    phasems : float
        The marker size to use for the main phased light curve plot symbols.

    phasebinms : float
        The marker size to use for the binned phased light curve plot symbols.

    Returns
    -------

    Does not return anything, works on the input Axes object directly.