예제 #1
0
qs = [0.6, 0.65, 0.707, 0.75, 0.8, 0.9]
ps = [0., 0.1, 0.2, 0.25, 0.3, 0.35, 0.4]

begin_color = Color("blue")
colors = list(begin_color.range_to(Color("green"), len(ps)))

for a in a_s:
    for q in qs:
        for p in ps:
            create.mass_function(q, p, a, clean=clean)

        plt.figure(1).set_size_inches((8, 8), forward=False)
        i = 0
        for p in ps:
            x_axis = dat.get_x_axis_mass_function(q, p, a)
            column = dat.get_column_mass_function(q, p, a)

            plt.plot(x_axis,
                     column,
                     color=colors[i].rgb,
                     label="p={0}".format(p))
            i += 1

        plt.xscale('log')
        plt.xlabel('M')
        plt.ylabel('$n(M)$')
        plt.title(
            "Mass function varying $p$, $q=${0}, $a=${1}".format(*[q, a]))
        plt.legend()
        os.system('mkdir -p figures/quantities/q={0}/a={1}'.format(*[q, a]))
        plt.savefig(
예제 #2
0
a_s = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]

q_st = 0.707
p_st = 0.3
begin_color = Color("blue")
colors = list(begin_color.range_to(Color("green"), len(a_s)))

plt.figure(1).set_size_inches((8, 8), forward=False)
i = 0
for a in a_s:

    create.mass_function(q_st, p_st, a, clean=clean)

    x_axis = dat.get_x_axis_mass_function(q_st, p_st, a)
    column = dat.get_column_mass_function(q_st, p_st, a)

    plt.plot(x_axis, column, color=colors[i].rgb, label="a={0}".format(a))
    i += 1

plt.xscale('log')
plt.yscale('log')
plt.xlabel('M')
plt.ylabel('$n(M)$')
plt.title("Mass function")
plt.legend()
os.system('mkdir -p figures/quantities/')
plt.savefig('figures/quantities/mass_function.png',
            dpi=200,
            bbox_inches='tight')