Commit a45c410b authored by Max Capelle's avatar Max Capelle

add plot settings: font sizes

parent 5b9c0411
This diff is collapsed.
......@@ -424,6 +424,27 @@ class Plot:
except:
self.traj_style = 'line'
# Figure properties
try:
self.fontsize_title = sets['fontsize_title']
except:
self.fontsize_title = 15
try:
self.fontsize_axislabel = sets['fontsize_axislabel']
except:
self.fontsize_axislabel = 12
try:
self.fontsize_axisticks = sets['fontsize_axisticks']
except:
self.fontsize_axisticks = 10
try:
self.fontsize_legend = sets['fontsize_legend']
except:
self.fontsize_legend = 10
class Settings:
......@@ -485,9 +506,8 @@ class Settings:
self.plot = sets['plot']
except:
raise IOError("Plot settings not given")
# System settings
# System settings
try:
self.time = sets['time']
except:
......
......@@ -82,11 +82,13 @@ def trajectory(bodies, settings, inds='all'):
plt.plot(x, y, color=col, lw=1)
plt.scatter(x[0], y[0], color=col, s=size(bodies[i].masses[num]))
plt.xlabel("$x$")
plt.ylabel("$y$")
plt.xlabel("$x$", fontsize = settings.plot.fontsize_axislabel)
plt.ylabel("$y$", fontsize = settings.plot.fontsize_axislabel)
plt.axis("equal")
plt.title("Trajectories during $T = {} [y_J]$".format(np.max(bodies[inds[0]].times)))
plt.legend(loc='lower right')
plt.title("Trajectories during $T = {} [y_J]$".format(np.max(bodies[inds[0]].times)),
fontsize = settings.plot.fontsize_title)
plt.legend(loc='lower right', fontsize = settings.plot.fontsize_legend)
plt.tick_params(labelsize = settings.plot.fontsize_axisticks)
plt.show()
......@@ -97,8 +99,10 @@ def trajectory(bodies, settings, inds='all'):
def plot_eccentricity(semi_major_axis,e):
# plot eccentricty to semi_major_axis
plt.plot(semi_major_axis,e,'b.')
plt.title('Astroid distribution')
plt.xlabel('Semi-major Axis [AU]'); plt.ylabel('Eccentricity [-]')
plt.title('Astroid distribution', fontsize = settings.plot.fontsize_title)
plt.xlabel('Semi-major Axis [AU]', fontsize = settings.plot.fontsize_axislabel)
plt.ylabel('Eccentricity [-]', fontsize = settings.plot.fontsize_axislabel)
plt.tick_params(labelsize = settings.plot.fontsize_axisticks)
plt.show()
def save_figure(figure, name):
......
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