my_a = np.array([2, 3, 5, 7, 10]) 
my_sigma_a = np.array([0.2, 0.3, 0.4, 0.7, 0.9]) 
my_b = np.array([2, 3, 6, 4, 8])
my_sigma_b = np.array([0.3, 0.3, 0.5, 0.5, 0.5]) 

# errors propagated using custom functions
my_sum_ab_l, my_sigma_sum_ab_l = sum_ab(a=my_a, b=my_b, sigma_a=my_sigma_a, sigma_b=my_sigma_b)
my_division_ab_l, my_sigma_division_ab_l = division_ab(a=my_a, b=my_b, sigma_a=my_sigma_a, sigma_b=my_sigma_b)

# errors propagated using the symbolic approach
my_sum_ab_s, my_sigma_sum_ab_s = symbolic_error_prop(func=a+b, val_a=my_a, val_sigma_a=my_sigma_a, val_b=my_b, val_sigma_b=my_sigma_b)
my_division_ab_s, my_sigma_division_ab_s = symbolic_error_prop(func=a/b, val_a=my_a, val_sigma_a=my_sigma_a, val_b=my_b, val_sigma_b=my_sigma_b)

fig = plt.figure(figsize=(8, 8))
ax1 = fig.add_subplot(2, 2, 1)
ax1.errorbar(x=my_a, y=my_sum_ab_l, xerr=my_sigma_a, yerr=my_sigma_sum_ab_l, linestyle='', marker='o', ecolor='k', elinewidth=0.5, capsize=1, label='Errors by custom functions')
ax1.set_xlabel('a')
ax1.set_ylabel('a + b')
ax1.legend()
ax2 = fig.add_subplot(2, 2, 2)
ax2.errorbar(x=my_a, y=my_sum_ab_s, xerr=my_sigma_a, yerr=my_sigma_sum_ab_s, linestyle='', marker='o', ecolor='k', elinewidth=0.5, capsize=1, label='Errors by the symbolic approach')
ax2.set_xlabel('a')
ax2.set_ylabel('a + b')
ax2.legend()
ax3 = fig.add_subplot(2, 2, 3)
ax3.errorbar(x=my_a, y=my_division_ab_l, xerr=my_sigma_a, yerr=my_sigma_division_ab_l, linestyle='', marker='o', ecolor='k', elinewidth=0.5, capsize=1, label='Errors by custom functions')
ax3.set_xlabel('a')
ax3.set_ylabel('a / b')
ax3.legend()
ax4 = fig.add_subplot(2,2,4)
ax4.errorbar(x=my_a, y=my_division_ab_s, xerr=my_sigma_a, yerr=my_sigma_division_ab_s, linestyle='', marker ='o', ecolor='k', elinewidth=0.5, capsize=1, label='Errors by the symbolic approach')
ax4.set_xlabel('a')
ax4.set_ylabel('a / b')
ax4.legend()
fig.tight_layout()