|
| 1 | +import os |
1 | 2 | import pickle |
2 | 3 | import matplotlib.pyplot as plt |
3 | 4 |
|
4 | | -plt.style.use('../lib/matplotlibrc') |
5 | 5 |
|
6 | 6 | def main(): |
7 | | - with open("../data/Obs_Trapezium_disksizes.pkl", 'r', encoding="utf-8") as filepointer: |
| 7 | + datadir = os.path.dirname(__file__) |
| 8 | + with open( |
| 9 | + os.path.join(datadir, "data") + "Obs_Trapezium_disksizes.pkl", |
| 10 | + "r", |
| 11 | + encoding="utf-8", |
| 12 | + ) as filepointer: |
8 | 13 | (radius_obs, yc_obs) = pickle.load(filepointer) |
9 | 14 |
|
10 | | - with open("../data/Tr_N2000_R0.5pc_Q0.5_F1.6.pkl", 'r', encoding="utf-8") as filepointer: |
| 15 | + with open( |
| 16 | + os.path.join(datadir, "data") + "Tr_N2000_R0.5pc_Q0.5_F1.6.pkl", |
| 17 | + "r", |
| 18 | + encoding="utf-8", |
| 19 | + ) as filepointer: |
11 | 20 | (radius_sim, yc_sim) = pickle.load(filepointer) |
12 | 21 |
|
13 | 22 | print(len(radius_obs), len(yc_obs)) |
14 | 23 | print(len(radius_sim), len(yc_sim)) |
15 | 24 |
|
16 | | - color = plt.rcParams['axes.prop_cycle'].by_key()['color'] |
| 25 | + color = plt.rcParams["axes.prop_cycle"].by_key()["color"] |
17 | 26 |
|
18 | | - x_label = r'R [$R_\odot$]' |
19 | | - y_label = '$f_{<R}$' |
| 27 | + x_label = r"R [$R_\odot$]" |
| 28 | + y_label = "$f_{<R}$" |
20 | 29 | figure = plt.figure(figsize=(8, 8)) |
21 | 30 | ax = figure.add_subplot(111) |
22 | 31 | ax.set_xlabel(x_label) |
23 | 32 | ax.set_ylabel(y_label) |
24 | 33 |
|
25 | | - ax.plot(radius_obs, 95*yc_obs, c=color[0]) |
26 | | - ax.plot(radius_sim, 95*yc_sim, c=color[1], ls="--") |
| 34 | + ax.plot(radius_obs, 95 * yc_obs, c=color[0]) |
| 35 | + ax.plot(radius_sim, 95 * yc_sim, c=color[1], ls="--") |
27 | 36 |
|
28 | 37 | plt.savefig("Tr_N2000_R05pc_Q05_F16_r1") |
29 | 38 |
|
|
0 commit comments