示例#1
0
def update_plots(fig, ax, plots, xss, yss):
    if len(plots) is not len(xss) \
        or len(plots) is not len(yss) \
        or len(xss) is not len(yss):
        raise ValueError("plots, xss, and yss need to be the same length!")

    for i in range(len(plots)):
        plot = plots[i]
        xs = xss[i]
        ys = yss[i]
        plot.set_xdata(xs)
        plot.set_ydata(ys)
    ax.relim()
    ax.autoscale_view()
    fig.canvas.draw()
    plt.pause(0.0001)
示例#2
0
plt.plot(tis, pulseshape_data, 'b-')
# plt.show()

plt.ion()
fig, ax = plt.subplots()
fig.suptitle(wave + ":" + ptitle)

p1, = plt.plot(p_t, sym1, 'b--', label="t=1")
p3, = plt.plot(p_t, sym3, 'r-', label="t=3")
p15, = plt.plot(p_t, sym12, 'g--', label="t=12")

plt.xlabel(r"width in $\hbar / a_max$")
plt.ylabel(r"$\phi(\rho_f, \rho_0)$")
plt.legend(loc='best')
plt.show()
plt.pause(0.0001)


def SCORPSEfac(partition):
    def a_SC(t):
        if t <= 0:
            return 0
        if t < ((pi / 3) * hoa):
            return -a_max
        if t <= 2 * pi * hoa:
            return a_max
        if t < (partition):
            return -a_max
        return 0

    return a_SC