Commit 109c44f7 authored by Olaf's avatar Olaf

Add error alpha to settings

parent 4e6c1c23
This diff is collapsed.
......@@ -448,7 +448,7 @@ class Plot:
try:
self.fontsize_title = sets['fontsize_title']
except:
self.fontsize_title = 15
self.fontsize_title = 13
try:
self.fontsize_axislabel = sets['fontsize_axislabel']
......@@ -464,6 +464,11 @@ class Plot:
self.fontsize_legend = sets['fontsize_legend']
except:
self.fontsize_legend = 10
try:
self.error_alpha = sets['error_alpha']
except:
self.error_alpha = 0.2
......
......@@ -122,7 +122,6 @@ def plot_energy(bodies, settings):
settings: objects.Settings class object
Settings for the interacting system
"""
error_alpha = 0.2
t = bodies[0].times
E_kin = np.zeros((len(t)))
E_pot = np.zeros((len(t)))
......@@ -145,13 +144,13 @@ def plot_energy(bodies, settings):
fig = plt.figure()
plt.plot(t, E_kin, color = 'yellow', label = 'Kinetic energy')
plt.fill_between(t, E_kin - E_kin_std, E_kin + E_kin_std, alpha = error_alpha, color = 'yellow')
plt.fill_between(t, E_kin - E_kin_std, E_kin + E_kin_std, alpha = settings.plot.error_alpha, color = 'yellow')
plt.plot(t, E_pot, color = 'blue', label = 'Potential energy')
plt.fill_between(t, E_pot - E_pot_std, E_pot + E_pot_std, alpha = error_alpha, color = 'blue')
plt.fill_between(t, E_pot - E_pot_std, E_pot + E_pot_std, alpha = settings.plot.error_alpha, color = 'blue')
plt.plot(t, E_kin + E_pot, color = 'green', label = 'Total energy')
plt.fill_between(t, E_kin + E_pot - E_std, E_kin + E_pot + E_std, alpha = error_alpha, color = 'green')
plt.fill_between(t, E_kin + E_pot - E_std, E_kin + E_pot + E_std, alpha = settings.plot.error_alpha, color = 'green')
plt.xlabel('time $[y_J]$', fontsize = settings.plot.fontsize_title)
plt.ylabel('Energy $[\\frac{Au^2}{Y^2}]$', fontsize = settings.plot.fontsize_title)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment