Talent

Sidebar

Nuclear Talent
Course 7
NT4A

plotting

One good option for plotting is to use PYTHON's matplotlib. Below a sample script you can modify. This one graphs contents of a file called liquid.dat

IF YOU MANAGE TO CREATE A USEFUL CODE TO PLOT XNET OUTPUT PLEASE POST HERE AND MODIFY THIS PAGE

from numpy import *
from pylab import *
from matplotlib import rc, rcParams
import matplotlib.units as units
import matplotlib.ticker as ticker
import sys
import os
# set tickers etc
rc('text',usetex=True)
rc('font',**{'family':'serif','serif':['Binding energies']})
title(r'{\bf Binding energies}', fontsize=20)
# read in data from file
l = len(BEdata[:,0])
x = BEdata[:,2]
y = BEdata[:,3]
z = BEdata[:,4]
axis([0,270,-1, 10.0])
xlabel(r'$A$',fontsize=20)
ylabel(r'$\mathrm{BE}$ [MeV]',fontsize=20)
plot(x, y ,'ro', x, z, 'bo', markersize=7)
# Save the figure in a separate file
savefig('beexpliquid.pdf', format='pdf')
# Draw the plot to screen
show()

The data file for this example looks like this:

   1   1   2      1.112300    0.991998    0.120302
1   2   3      2.827267    0.368785    2.458482
1   3   4      1.720450   -1.640617    3.361067
1   4   5      1.336360   -3.337299    4.673659
1   5   6      0.961633   -4.647357    5.608990
1   6   7      1.111686   -5.656402    6.768088
2   1   3      2.572667   -0.126275    2.698941
2   2   4      7.073925    3.822039    3.251886
2   3   5      5.512140    3.836172    1.675968
2   4   6      4.878400    2.889512    1.988888
2   5   7      4.123914    1.759144    2.364770
2   6   8      3.924525    0.671628    3.252897
2   7   9      3.477355   -0.310644    3.787999
2   8  10      3.033860   -1.178539    4.212399
3   1   4      1.153750   -2.540201    3.693951
3   2   5      5.266140    3.418622    1.847518
3   3   6      5.332333    5.139848    0.192485
3   4   7      5.606442    5.280293    0.326149
3   5   8      5.159712    4.798504    0.361208
3   6   9      5.037767    4.081375    0.956392
3   7  10      4.531350    3.295756    1.235594
3   8  11      4.155364    2.515579    1.639785
3   9  12      3.799083    1.772972    2.026111
3  10  13      3.403000    1.080470    2.322530
4   2   6      4.487250    2.103653    2.383597