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 fig,ax = plt.subplots(1,3,figsize=(10,4),sharex=True,sharey=True)
11 
12 plt.subplots_adjust(hspace=0,wspace=0)
13 
14 
15 
16 # Load data from the mainout
17 mrsn_example = winnet('.')
18 
19 # We have to know the time of the snapshots
20 snapshot_time = [10,1.8E+03,8.64E+04] # In seconds. 10s, 30min, 1day
21 
22 # Plot everything in the nuclear chart. Only the last ax object has the colorbar
23 mrsn_example.plot_nuclear_chart_at(snapshot_time[0],figure=ax[0],axes_label=False,element_labels=False,fig_is_ax=True,colorbar=False)
24 mrsn_example.plot_nuclear_chart_at(snapshot_time[1],figure=ax[1],axes_label=False,element_labels=False,fig_is_ax=True,colorbar=False)
25 mrsn_example.plot_nuclear_chart_at(snapshot_time[2],figure=ax[2],axes_label=False,element_labels=False,fig_is_ax=True,colorbar=True,
26  colorbar_position=[0.27, 0.85, 0.5, 0.025],colorbar_inset=True)
27 
28 ax[0].set_ylabel("Proton number")
29 fig.text(0.5,0.15,"Neutron number",ha="center")
30 
31 ax[0].set_xlim(9,59)
32 ax[0].set_ylim(15,49)
33 plt.savefig("massfractions_chart_nup_obergaulinger.pdf",bbox_inches="tight")
34 plt.show()