Plot_me.py
Go to the documentation of this file.
1
# Author: M. Reichert
2
import
numpy
as
np
3
import
matplotlib.pyplot
as
plt
4
# Import the WinNet python plot-routine
5
# Note that you can also just append the path to your .bashrc
6
import
sys
7
sys.path.append(
'../../bin'
)
8
from
class_files.winnet_class
import
winnet
9
10
# Create the figure objects
11
fig = plt.figure(figsize=(8,4))
12
ax = fig.gca()
13
14
path =
"bin_"
15
16
# Plot all bins
17
for
i
in
range(1,5):
18
# Create the proper path
19
p_tmp = path+str(i)+
".dat"
20
# Read the final abundances
21
run = winnet(p_tmp)
22
run.read_finab()
23
A,X = run.get_final_A_X()
24
25
plt.plot(A,X,label=
"Bin "
+str(i))
26
27
28
plt.ylim(1e-8,1)
29
plt.legend()
30
plt.xlabel(
"Mass number"
)
31
plt.ylabel(
"Mass fraction"
)
32
plt.yscale(
"log"
)
33
plt.savefig(
"final_massfractions.pdf"
,bbox_inches=
"tight"
)
34
plt.show()
data
Example_data
Example_NSM_wind_bins_martin
scripts
Plot_me.py