def iris_timeplot_fig(a_vals = sample_a_vals, border = 0.3):
    # set up the model parameters for this figure
    l_cw = -default_lambda
    l_ccw = 1
    X = Y = 1.
    n_phis = np.linspace(0, 2*math.pi, 20*4 + 1)
    a_phis = np.linspace(0, 2*math.pi, 100*4 + 1)
    dx = 1e-4
    dy = 0.
    mag = math.sqrt(dx**2 + dy**2)
    phasescale = 4 / (2 * math.pi) # convert from (0,2 \pi) to (0,4)

    # create a new figure
    fig = plt.figure(figsize=(6,6))

    width = 1./len(a_vals)
    padding = 0.2*width

    for i in range(len(a_vals)):
        a = a_vals[i]

        axes = plt.axes((2*padding, 1-(i+1) * width+padding,
            1 - width - 2*padding, width - 1.5*padding))

        # draw the trajectory components vs. time
        r0 = iris.iris_fixedpoint(a, l_ccw, l_cw, X, Y, guess=1e-6*X)
        T = 4 * iris.dwell_time(r0, l_ccw, l_cw, X, Y)
        ts = np.linspace(0, 3*T, 1000);
        vals = integrate.odeint(iris.iris,
                [-a/2, -a/2 - Y + r0],
                ts,
                args=(a, l_ccw, l_cw, X, Y))
        axes.plot(ts, vals[:,1], '-', color='0.8', lw=2)
        axes.plot(ts, vals[:,0], 'k-', lw=2)

        axes.set_xlim(0, 3*T)

        # make the y-axis symmetric around zero
        #ymaxabs = np.max(np.abs(axes.get_ylim()))
        ymaxabs = 1.2
        axes.set_ylim(-ymaxabs, ymaxabs)


        # draw the phase plot for reference
        axes = plt.axes((1-width, 1-(i+1) * width, width, width))
        iris.draw_fancy_iris(axes, a, l_ccw, l_cw, X, Y,
                scale=3.0, x0=np.nan)

        # center the plot and clean up the scale bars
        axes.set_xlim(-2*X-border, 2*X+border)
        axes.set_ylim(-2*Y-border, 2*Y+border)
        axes.set_xticks([])
        axes.set_yticks([])
        axes.set_frame_on(False)

    return fig
def nomenclature_fig():
    # set up the model parameters for this figure
    a = 0.1
    l_cw = -default_lambda
    l_ccw = 1
    X = Y = 1.
    def saddlefunc(y,t):
        return [y[0]*l_cw, y[1]*l_ccw]

    # create a new figure
    fig = plt.figure(figsize=(6,6))
    axes = fig.add_axes([0.1, 0.1, 0.8, 0.8])

    # draw the axes
    iris.draw_saddle_neighborhood(axes, -X, -Y, 2*X, 2*Y, True, False,
            scale=0.7)

    axes.text(-1.05, 0.5, '$Y$',
            horizontalalignment = 'right', verticalalignment='center')
    axes.text(0.5, -1.05, '$X$',
            horizontalalignment = 'center', verticalalignment='top')

    # draw the stable limit cycle
    r0 = iris.iris_fixedpoint(a, l_ccw, l_cw, X, Y, guess=1e-6*X)
    vals = integrate.odeint(saddlefunc, [X,r0],
            np.linspace(0, iris.dwell_time(r0, l_ccw, l_cw, X, Y), 1000),
            )#args=(a, l_ccw, l_cw, X, Y))
    axes.plot(vals[:,0], vals[:,1], 'k', lw=2)

    # draw a sample trajectory
    x0 = [X, r0*2]
    vals = integrate.odeint(saddlefunc, x0,
            np.linspace(0, iris.dwell_time(x0[1], l_ccw, l_cw, X, Y), 1000),
            )#args=(a, l_ccw, l_cw, X, Y))
    axes.plot(vals[:,0], vals[:,1], 'b', lw=1)

    # center the plot and clean up the scale bars
    axes.set_xlim(-X, X)
    axes.set_ylim(-Y, Y)
    axes.set_xticks([])
    axes.set_yticks([])
    axes.set_frame_on(False)
    return fig