update markers and labels

This commit is contained in:
Andrejh 2021-08-18 10:04:40 +02:00
parent 93662ad875
commit 9e04e2e2f2

View file

@ -92,19 +92,19 @@ ax.set_yscale('log')
coleman_etal_vl = [np.log10(821065925.4), np.log10(1382131207), np.log10(81801735.96), np.log10(
487760677.4), np.log10(2326593535), np.log10(1488879159), np.log10(884480386.5)]
coleman_etal_er = [127, 455.2, 281.8, 884.2, 448.4, 1100.6, 621]
plt.scatter(coleman_etal_vl, coleman_etal_er)
plt.scatter(coleman_etal_vl, coleman_etal_er, marker='x')
x_hull, y_hull = get_enclosure_points(coleman_etal_vl, coleman_etal_er)
# plot shape
plt.fill(x_hull, y_hull, '--', c='orange', alpha=0.2)
############# Markers #############
markers = ['*', 'v', 's']
markers = [5, 'd', 4]
############# Milton et al #############
milton_vl = [np.log10(8.30E+04), np.log10(4.20E+05), np.log10(1.80E+06)]
milton_er = [22, 220, 1120] # removed first and last due to its dimensions
plt.scatter(milton_vl[0], milton_er[0], marker=markers[0], color='red')
plt.scatter(milton_vl[1], milton_er[1], marker=markers[1], color='red')
plt.scatter(milton_vl[1], milton_er[1], marker=markers[1], color='red', s=50)
plt.scatter(milton_vl[2], milton_er[2], marker=markers[2], color='red')
x_hull, y_hull = get_enclosure_points(milton_vl, milton_er)
# plot shape
@ -115,7 +115,7 @@ plt.fill(x_hull, y_hull, '--', c='red', alpha=0.2)
yan_vl = [np.log10(7.86E+07), np.log10(2.23E+09), np.log10(1.51E+10)]
yan_er = [8396.78166, 45324.55964, 400054.0827]
plt.scatter(yan_vl[0], yan_er[0], marker=markers[0], color='green')
plt.scatter(yan_vl[1], yan_er[1], marker=markers[1], color='green')
plt.scatter(yan_vl[1], yan_er[1], marker=markers[1], color='green', s=50)
plt.scatter(yan_vl[2], yan_er[2], marker=markers[2], color='green')
x_hull, y_hull = get_enclosure_points(yan_vl, yan_er)
@ -155,23 +155,23 @@ plt.fill(x_hull, y_hull, '--', c='green', alpha=0.2)
############ Legend ############
result_from_model = mlines.Line2D(
[], [], color='blue', marker='_', linestyle='None')
coleman = mlines.Line2D([], [], color='orange', marker='o', linestyle='None')
coleman = mlines.Line2D([], [], color='orange', marker='x', linestyle='None')
milton_mean = mlines.Line2D(
[], [], color='red', marker='v', linestyle='None') # mean
[], [], color='red', marker='d', linestyle='None') # mean
milton_25 = mlines.Line2D(
[], [], color='red', marker='*', linestyle='None') # 25
[], [], color='red', marker=5, linestyle='None') # 25
milton_75 = mlines.Line2D(
[], [], color='red', marker='s', linestyle='None') # 75
[], [], color='red', marker=4, linestyle='None') # 75
yann_mean = mlines.Line2D([], [], color='green',
marker='v', linestyle='None') # mean
marker='d', linestyle='None') # mean
yann_25 = mlines.Line2D([], [], color='green',
marker='*', linestyle='None') # 25
marker=5, linestyle='None') # 25
yann_75 = mlines.Line2D([], [], color='green',
marker='s', linestyle='None') # 75
marker=4, linestyle='None') # 75
title_proxy = Rectangle((0, 0), 0, 0, color='w')
titles = ["$\\bf{CARA \, (SARS-CoV-2):}$", "$\\bf{Coleman \, et \, al. \, (SARS-CoV-2):}$",
"$\\bf{Milton \, et \, al. \,(Influenza):}$", "$\\bf{Yann \, et \, al. \,(Influenza):}$"]
titles = ["$\\bf{CARA \, \\it{(SARS-CoV-2)}:}$", "$\\bf{Coleman \, et \, al. \, \\it{(SARS-CoV-2)}:}$",
"$\\bf{Milton \, et \, al. \,\\it{(Influenza)}:}$", "$\\bf{Yann \, et \, al. \,\\it{(Influenza)}:}$"]
leg = plt.legend([title_proxy, result_from_model, title_proxy, coleman, title_proxy, milton_mean, milton_25, milton_75, title_proxy, yann_mean, yann_25, yann_75],
[titles[0], "Result from model", titles[1], "Dataset", titles[2], "Mean", "25th per.", "75th per.", titles[3], "Mean", "25th per.", "75th per."])