Fixed bug 'plot_type' not found.

The variable 'plot_type' was changed to 'stem'.
This commit is contained in:
Sylvain Tricot 2022-03-07 14:17:20 +01:00
parent 2da7549d99
commit babfb58a07
1 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,8 @@ for d in densities:
# compute the corresponding averaged radius (in Bohr units) # compute the corresponding averaged radius (in Bohr units)
rs = ( (1/d) / ((4/3) * np.pi) ) ** (1/3) / a0 rs = ( (1/d) / ((4/3) * np.pi) ) ** (1/3) / a0
# Some output printing # Some output printing
print("Computing {} for RS={}".format(plot_type, rs)) stem = 'plas_disp'
print("Computing {} for RS={}".format(stem, rs))
# Here is the actual call to calculate # Here is the actual call to calculate
data = compute(N_Q=100, RS=rs, T=T) data = compute(N_Q=100, RS=rs, T=T)
# 'data' is a dict, each key is the name of an output file (without extansion). # 'data' is a dict, each key is the name of an output file (without extansion).
@ -53,7 +54,7 @@ for d in densities:
# the number of points chosen and on the kind of output file. # the number of points chosen and on the kind of output file.
# Reading data # Reading data
X, Y = data['plas_disp'].T X, Y = data[stem].T
# Plotting # Plotting
plt.plot(X, Y, label=r'density={:.2e} $e/cm^3$'.format(d)) plt.plot(X, Y, label=r'density={:.2e} $e/cm^3$'.format(d))