Comparison of Abandon with Complete - Part I

Comparison of two datasets

  • All results of comparison have been computed by tom.py, and in this document, only reading from the result files is needed.
  • Comparison will be performed from the following dimensions.
    1. Agreement Score
      1. pairwise
      2. pairw with discount factor
      3. distance
    2. Time spent
      1. questions time
      2. reading tim3

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

import time, os, json

DATA_DIR = "data-180716/s4/"
DATA_PROCESSED_DIR = "data-180716/0-data-processed/"

1. Agreement Score

1.1 By Pairwise Agreement

dbSubmit_pairw = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'agreementScore.submit', lines = True, encoding = 'utf-8', orient = "records")
dbAbandon_pairw = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'agreementScore.abandon', lines = True, encoding = 'utf-8', orient = "records")

dbSubmit_pairw.head()
agreeScore id_unit topic worker_id
0 1.0 440_0 440 44277308
1 1.0 440_1 440 43551505
2 1.0 440_2 440 44427233
3 1.0 440_3 440 43603766
4 1.0 440_4 440 24425089
dbAbandon_pairw.head()
agreeScore id_unit topic worker_id
0 1.000000 440_328 440 17708868
1 0.000000 440_390 440 18490425
2 0.000000 440_355 440 22352538
3 1.000000 440_355 440 25569616
4 0.333333 440_343 440 31265048
# distribution of the score
print 'Agreement Score for those who Submitted'
dbSubmit_pairw.describe().agreeScore
Agreement Score for those who Submitted
count    7065.000000
mean        0.815644
std         0.244893
min         0.000000
25%         0.666667
50%         1.000000
75%         1.000000
max         1.000000
Name: agreeScore, dtype: float64
print 'Agreement Score for those who Abandoned'
dbAbandon_pairw.describe().agreeScore
Agreement Score for those who Abandoned
count    2279.000000
mean        0.432163
std         0.414976
min         0.000000
25%         0.000000
50%         0.400000
75%         1.000000
max         1.000000
Name: agreeScore, dtype: float64

Summary 1.1.1 - Distribution - (1)

  • The number of all valid completion (full coverage of groundtruth questions) in Complete dataset is 7065, while there are only 2279 observed First attempts of HITs with a full coverage of groundtruth questions.
  • The average Agreement Score is 81.56% for those who completed, while it is only 43.22% for those who abandoned.

# plot in histogram
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = fig.add_subplot(111, frame_on = False)

# agree score of completed
color2 = 'gray'
ax1.hist(dbAbandon_pairw['agreeScore'], label = 'abandoned', color = color2, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 11)
ax1.set_xlabel('Agreement Score of those who Abandoned', color = color2)
ax1.set_ylabel('frequency of occurrence', color = color2)
ax1.tick_params(axis='x', labelcolor = color2)
ax1.tick_params(axis='y', labelcolor = color2)

# agree score of abandoned
color1 = 'orange'
ax2.hist(dbSubmit_pairw['agreeScore'], label = 'completed', color = color1, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 11)
#ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.xaxis.set_label_position('top')
ax2.yaxis.set_label_position('right')
ax2.set_xlabel('Agreement Score of those who Completed', color = color1)
ax2.set_ylabel('frequency of occurrence', color = color1)
ax2.tick_params(axis = 'x', labelcolor = color1)
ax2.tick_params(axis = 'y', labelcolor = color1)

fig.legend(loc='upper right', bbox_to_anchor=(0.66, 0.87), ncol=1, fancybox=True, shadow=True)
plt.show()
# comparison of distribution
plt.hist([dbAbandon_pairw['agreeScore'], dbSubmit_pairw['agreeScore']], label = ['abandoned', 'completed'], density = True, edgecolor = 'white', linewidth = 0, bins = 11)
plt.xlabel('Agreement Score')
plt.ylabel('density of probability')
plt.legend(loc = 'upper right', bbox_to_anchor = (0.75, 0.98), ncol = 1, fancybox = True, shadow = True)
plt.title('Comparison of Probability Density')
plt.show()

Summary 1.1.2 - Frequency and Probability Density - (2)

  • Nearly 4000 (out of 7065) HITs were completed with an agreement score that equals to 1 (100%), and another more than 2000 agreement scores of HITs were normally distributed around 70%. On the contrary, for the group of abandoned tasks, the number of tasks with a zero (0%) agreement score is much more than those with an agreement score 1 (100%), and the remainings were normally distributed around 50% agreement score point with a left skewness.

1.2 Introducing Discounted Factor

dbSubmit_pairwDiscount = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'agreementScoreDiscount.submit', lines = True, encoding = 'utf-8', orient = "records")
dbAbandon_pairwDiscount = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'agreementScoreDiscount.abandon', lines = True, encoding = 'utf-8', orient = "records")

dbSubmit_pairwDiscount.head()
agreeScore id_unit topic worker_id
0 0.500000 402_0 402 40725179
1 1.000000 402_1 402 43679833
2 0.666667 402_2 402 43988022
3 0.000000 402_3 402 39259897
4 0.500000 402_4 402 34840514
dbAbandon_pairwDiscount.head()
agreeScore id_unit topic worker_id
0 0.666667 402_381 402 6339730
1 0.000000 402_362 402 7202055
2 0.000000 402_329 402 12542684
3 0.000000 402_262 402 15358071
4 0.333333 402_110 402 21781365
# distribution of the score
print 'Agreement Score (discounted) for those who Submitted'
dbSubmit_pairwDiscount.describe().agreeScore
Agreement Score (discounted) for those who Submitted
count    7065.000000
mean        0.654855
std         0.269804
min         0.000000
25%         0.500000
50%         0.666667
75%         1.000000
max         1.000000
Name: agreeScore, dtype: float64
print 'Agreement Score (discounted) for those who Abandoned'
dbAbandon_pairwDiscount.describe().agreeScore
Agreement Score (discounted) for those who Abandoned
count    2278.000000
mean        0.321269
std         0.346084
min         0.000000
25%         0.000000
50%         0.250000
75%         0.583333
max         1.000000
Name: agreeScore, dtype: float64

Summary 1.2.1 - Distribution - (1)

  • Inconsistency observed: The number of valid First attempts of the tasks in Abandoned dataset is 2278, while it was 2279 in previous section. This is because, by definition of pairwise agreement function, if there is only one element in vector, the agreement score is set to be 1 (100%) by default, which may not be correct. In this case, the groundtruth is "(3)" (only one dimension), but the worker answered "(none)", so it should be invalid to discard.
  • The average Agreement Score is 65.48% (compared with 81.56% without discounted factor) for those who completed, while it is only 32.13% (43.21% without discounted factor) for those who abandoned.
  • Both of the average scores of Complete and Abandon have decreased by 10-20 percentiles, which shows that discounted factor could improve our judgment in the quality of the workers by setting up more strict criterion.

# plot in histogram
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = fig.add_subplot(111, frame_on = False)

# agree score of completed
color2 = 'gray'
ax1.hist(dbAbandon_pairwDiscount['agreeScore'], label = 'abandoned', color = color2, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 11)
ax1.set_xlabel('Agreement Score of those who Abandoned', color = color2)
ax1.set_ylabel('frequency of occurrence', color = color2)
ax1.tick_params(axis='x', labelcolor = color2)
ax1.tick_params(axis='y', labelcolor = color2)

# agree score of abandoned
color1 = 'orange'
ax2.hist(dbSubmit_pairwDiscount['agreeScore'], label = 'completed', color = color1, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 11)
#ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.xaxis.set_label_position('top')
ax2.yaxis.set_label_position('right')
ax2.set_xlabel('Agreement Score of those who Completed', color = color1)
ax2.set_ylabel('frequency of occurrence', color = color1)
ax2.tick_params(axis = 'x', labelcolor = color1)
ax2.tick_params(axis = 'y', labelcolor = color1)

fig.legend(loc='upper right', bbox_to_anchor=(0.66, 0.87), ncol=1, fancybox=True, shadow=True)
plt.show()
# comparison of distribution
plt.hist([dbAbandon_pairwDiscount['agreeScore'], dbSubmit_pairwDiscount['agreeScore']], label = ['abandoned', 'completed'], density = True, edgecolor = 'white', linewidth = 0, bins = 11)
plt.xlabel('Agreement Score')
plt.ylabel('density of probability')
plt.legend(loc = 'upper right', bbox_to_anchor = (0.75, 0.98), ncol = 1, fancybox = True, shadow = True)
plt.title('Comparison of Probability Density')
plt.show()

Summary 1.2.2 - Frequency and Probability Density - (2)

  • By introducing discounted factor, the dictribution is totally different from that without it.
  • In the group of Complete, a huge number of HITs with a 1 (100%) agreement score were moved to be distributed in the middle (40-80%), only leaving about 1750 (43% = 1750/4000) remaining at the top (position of 1 or 100% in agreement score).
  • In the group of Abandon, about 200 HITs were moved to the middle, resulting in increasing the number (up to 1000) of those with zero (0%) agreement score and almost uniform distribution across all other agreement scores.
  • The phenomenon of "left-moving" in both datasets strongly indicates that with the introduction of discounted factor, the quality of the workers could be reflected much closer to the reality, by eleminating the errors caused by some extreme values.

1.3 Agreement Distance

dbSubmit_agreeDistance = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'agreementDistanceScore.submit', lines = True, encoding = 'utf-8', orient = "records")
dbAbandon_agreeDistance = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'agreementDistanceScore.abandon', lines = True, encoding = 'utf-8', orient = "records")

dbSubmit_agreeDistance.head()
agreeScore id_unit topic worker_id
0 0.666667 402_0 402 40725179
1 1.000000 402_1 402 43679833
2 0.666667 402_2 402 43988022
3 0.528595 402_3 402 39259897
4 0.472954 402_4 402 34840514
dbAbandon_agreeDistance.head()
agreeScore id_unit topic worker_id
0 0.666667 402_381 402 6339730
1 0.254644 402_362 402 7202055
2 0.666667 402_329 402 12542684
3 0.764298 402_262 402 15358071
4 0.333333 402_110 402 21781365
# distribution of the score
print 'Agreement Distance Score for those who Submitted'
dbSubmit_agreeDistance.describe().agreeScore
Agreement Distance Score for those who Submitted
count    7065.000000
mean        0.758202
std         0.178742
min         0.183503
25%         0.627322
50%         0.764298
75%         1.000000
max         1.000000
Name: agreeScore, dtype: float64
print 'Agreement Distance Score for those who Abandoned'
dbAbandon_agreeDistance.describe().agreeScore
Agreement Distance Score for those who Abandoned
count    2278.000000
mean        0.542464
std         0.237948
min         0.000000
25%         0.376390
50%         0.505587
75%         0.727834
max         1.000000
Name: agreeScore, dtype: float64

Summary 1.3.1 - Distribution - (1)

  • Comparison of the distributions of agreement score by three methods.
Submit dataset Average Minimum
Pairwise Agreement 81.56% 0
PairW with Discount Factor 65.48% 0
Agreement Distance Score 75.82% 18.35%
Abandon dataset Average Minimum
Pairwise Agreement 43.22% 0
PairW with Discount Factor 32.13% 0
Agreement Distance Score 54.25% 0
  • The minimum value of Agreement Distance Score in Submit dataset is 18.35%, while it was 0 by previous two methods. It tells us the workers in Submit dataset answered at least one question correctly, although they may make mistakes in other questions within the same HITs.
  • The average Agreement Distance Score is 54.25% in Abandon dataset, much higher than it by any other methods, which gives us some clue that the workers may answer individual questions correctly but they failed in correctly answering all of a series of questions. Or we can say their correct answer of individual questions may be as a result of both random guess plus some kind of non-perfect judgments.

# plot in histogram
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = fig.add_subplot(111, frame_on = False)

# agree score of completed
color2 = 'gray'
ax1.hist(dbAbandon_agreeDistance['agreeScore'], label = 'abandoned', color = color2, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 11)
ax1.set_xlabel('Agreement Score of those who Abandoned', color = color2)
ax1.set_ylabel('frequency of occurrence', color = color2)
ax1.tick_params(axis='x', labelcolor = color2)
ax1.tick_params(axis='y', labelcolor = color2)

# agree score of abandoned
color1 = 'orange'
ax2.hist(dbSubmit_agreeDistance['agreeScore'], label = 'completed', color = color1, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 11)
#ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.xaxis.set_label_position('top')
ax2.yaxis.set_label_position('right')
ax2.set_xlabel('Agreement Score of those who Completed', color = color1)
ax2.set_ylabel('frequency of occurrence', color = color1)
ax2.tick_params(axis = 'x', labelcolor = color1)
ax2.tick_params(axis = 'y', labelcolor = color1)

fig.legend(loc='upper right', bbox_to_anchor=(0.35, 0.88), ncol=1, fancybox=True, shadow=True)
plt.show()
# comparison of distribution
plt.hist([dbAbandon_agreeDistance['agreeScore'], dbSubmit_agreeDistance['agreeScore']], label = ['abandoned', 'completed'], density = True, edgecolor = 'white', linewidth = 0, bins = 11)
plt.xlabel('Agreement Score')
plt.ylabel('density of probability')
plt.legend(loc = 'upper right', bbox_to_anchor = (0.55, 0.98), ncol = 1, fancybox = True, shadow = True)
plt.title('Comparison of Probability Density')
plt.show()

Summary 1.3.2 - Frequency and Probability Density - (2)

  • The two plots shows that the distribution of the two datasets overlaps significantly.
  • For the values below their average, the group of Submit moves right-forward by about 20 percentiles.
  • But for the values above their average, both of the dataset have a significant decreasing in their distribution at 70% and 90% percentile. (cause by non-linear function?)

1.4 alpha

dbSubmit_alpha = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'alphaScore.submit', lines = True, encoding = 'utf-8', orient = "records")
dbAbandon_alpha = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'alphaScore.abandon', lines = True, encoding = 'utf-8', orient = "records")

dbSubmit_alpha.head()
agreeScore id_unit topic worker_id
0 1.000000 448_0 448 39394021
1 0.888889 448_1 448 32591740
2 1.000000 448_2 448 43893467
3 0.923077 448_3 448 24425089
4 1.000000 448_5 448 43683312
dbAbandon_alpha.head()
agreeScore id_unit topic worker_id
0 0.00000 448_117 448 13396426
1 0.90566 448_460 448 21707202
2 0.06250 448_495 448 21781365
3 -0.25000 448_671 448 23035689
4 1.00000 448_314 448 28736191
# distribution of the score
print 'Alpha value for those who Submitted'
dbSubmit_alpha.describe().agreeScore
Alpha value for those who Submitted
count    7065.000000
mean        0.737320
std         0.295451
min        -0.666667
25%         0.561404
50%         0.878049
75%         1.000000
max         1.000000
Name: agreeScore, dtype: float64
print 'Alpha value for those who Abandoned (including those who only covered partial groundtruth)'
dbAbandon_alpha.describe().agreeScore
Alpha value for those who Abandoned (including those who only covered partial groundtruth)
count    2972.000000
mean        0.329328
std         0.480447
min        -0.765432
25%         0.000000
50%         0.210526
75%         0.888889
max         1.000000
Name: agreeScore, dtype: float64
# plot in histogram
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = fig.add_subplot(111, frame_on = False)

# agree score of completed
color2 = 'gray'
ax1.hist(dbAbandon_alpha['agreeScore'], label = 'abandoned', color = color2, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 21)
ax1.set_xlabel('Alpha value of those who Abandoned', color = color2)
ax1.set_ylabel('frequency of occurrence', color = color2)
ax1.tick_params(axis='x', labelcolor = color2)
ax1.tick_params(axis='y', labelcolor = color2)

# agree score of abandoned
color1 = 'orange'
ax2.hist(dbSubmit_alpha['agreeScore'], label = 'completed', color = color1, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 21)
#ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.xaxis.set_label_position('top')
ax2.yaxis.set_label_position('right')
ax2.set_xlabel('Alpha value of those who Completed', color = color1)
ax2.set_ylabel('frequency of occurrence', color = color1)
ax2.tick_params(axis = 'x', labelcolor = color1)
ax2.tick_params(axis = 'y', labelcolor = color1)

fig.legend(loc='upper right', bbox_to_anchor=(0.36, 0.87), ncol=1, fancybox=True, shadow=True)
plt.show()
# comparison of distribution
plt.hist([dbAbandon_alpha['agreeScore'], dbSubmit_alpha['agreeScore']], label = ['abandoned', 'completed'], density = True, edgecolor = 'white', linewidth = 0, bins = 11)
plt.xlabel('Alpha value')
plt.ylabel('density of probability')
plt.legend(loc = 'upper right', bbox_to_anchor = (0.55, 0.98), ncol = 1, fancybox = True, shadow = True)
plt.title('Comparison of Probability Density')
plt.show()

2. Time spent

2.1 Question time

dbSubmit_qTime = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'questionTime.submit', lines = True, encoding = 'utf-8', orient = "records")
dbAbandon_qTime = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'questionTime.abandon', lines = True, encoding = 'utf-8', orient = "records")

dbSubmit_qTime.head()
firstAttempt questionNo session startAnswer timeAnswering topic unit_id worker_id
0 1 1 00IHERDN 1527258196396 118639 402 402_249 40184183
1 1 2 00IHERDN 1527258315035 41881 402 402_249 40184183
2 1 3 00IHERDN 1527258356916 27079 402 402_249 40184183
3 1 4 00IHERDN 1527258383995 12109 402 402_249 40184183
4 1 5 00IHERDN 1527258396104 29694 402 402_249 40184183
dbAbandon_qTime.head()
firstAttempt questionNo session startAnswer timeAnswering topic unit_id worker_id
0 1 1 06OLRL28 1527304131192 43152 402 402_364 42728666
1 1 1 0EMGNCFS 1527350920131 104484 402 402_206 30766630
2 1 1 0UHFTWVD 1527303586705 36080 402 402_419 29929036
3 1 1 1AUJBOJS 1527280797646 505151 402 402_54 43818439
4 1 2 1AUJBOJS 1527281302797 180781 402 402_54 43818439
# plot in histogram
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = fig.add_subplot(111, frame_on = False)

# (DB Abandon) time on each question (extreme large value removed, because it is minor/noisy)
color2 = 'gray'
ax1.hist(dbAbandon_qTime.loc[dbAbandon_qTime['timeAnswering'] < 420001]['timeAnswering'], label = 'abandoned', color = color2, alpha=0.99, density = True, edgecolor = 'white', linewidth = 0.7, bins = 42)
ax1.set_xlabel('Time in Answering Questions by those who Abandoned', color = color2)
ax1.set_ylabel('frequency of occurrence', color = color2)
ax1.tick_params(axis='x', labelcolor = color2)
ax1.tick_params(axis='y', labelcolor = color2)

# DB Submit
color1 = 'orange'
ax2.hist(dbSubmit_qTime.loc[dbSubmit_qTime['timeAnswering'] < 420001]['timeAnswering'], label = 'completed', color = color1, alpha=0.5, density = True, edgecolor = 'white', linewidth = 0.7, bins = 42)
#ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.xaxis.set_label_position('top')
ax2.yaxis.set_label_position('right')
ax2.set_xlabel('Time in Answering Questions by those who Completed', color = color1)
ax2.set_ylabel('frequency of occurrence', color = color1)
ax2.tick_params(axis = 'x', labelcolor = color1)
ax2.tick_params(axis = 'y', labelcolor = color1)

fig.legend(loc='upper right', bbox_to_anchor=(0.85, 0.88), ncol=1, fancybox=True, shadow=True)
plt.show()


2.2 Reading time

dbSubmit_readTime = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'readingTime.submit', lines = True, encoding = 'utf-8', orient = "records")
dbAbandon_readTime = pd.read_json(path_or_buf = DATA_PROCESSED_DIR + 'readingTime.abandon', lines = True, encoding = 'utf-8', orient = "records")

dbSubmit_readTime.head()
seqNo session startReading timeReading topic unit_id worker_id
0 0 00IHERDN 1527258022739 173657 402 402_249 40184183
1 0 00RDHC6V 1527269771050 372910 402 402_189 39419416
2 0 02TX0VU3 1527293156487 170004 402 402_180 35146139
3 0 03UCJ3MV 1527283325650 259912 402 402_187 43519786
4 0 05M5NN5N 1527261466747 1308340 402 402_217 43703303
dbAbandon_readTime.head()
seqNo session startReading timeReading topic unit_id worker_id
0 0 06OLRL28 1527304048102 83090 402 402_364 42728666
1 0 0EMGNCFS 1527350868401 51730 402 402_206 30766630
2 0 0EVP8APV 1527334146395 37744 402 402_86 44026798
3 0 0UHFTWVD 1527303375710 210995 402 402_419 29929036
4 0 0UQ8BD2J 1527269442117 360481 402 402_375 42770105
# plot in histogram
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax2 = fig.add_subplot(111, frame_on = False)

# (DB Abandon) time in reading instructions (extreme large value removed, because it is minor/noisy)
color2 = 'gray'
ax1.hist(dbAbandon_readTime.loc[dbAbandon_readTime['timeReading'] < 1800001]['timeReading'], label = 'abandoned', color = color2, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 180)
ax1.set_xlabel('Time in Reading Instructions by those who Abandoned', color = color2)
ax1.set_ylabel('frequency of occurrence', color = color2)
ax1.tick_params(axis='x', labelcolor = color2)
ax1.tick_params(axis='y', labelcolor = color2)

# DB Submit
color1 = 'orange'
ax2.hist(dbSubmit_readTime.loc[dbSubmit_readTime['timeReading'] < 1800001]['timeReading'], label = 'completed', color = color1, alpha=0.5, density = False, edgecolor = 'white', linewidth = 0.7, bins = 180)
#ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.xaxis.tick_top()
ax2.yaxis.tick_right()
ax2.xaxis.set_label_position('top')
ax2.yaxis.set_label_position('right')
ax2.set_xlabel('Time in Reading Instructions by those who Completed', color = color1)
ax2.set_ylabel('frequency of occurrence', color = color1)
ax2.tick_params(axis = 'x', labelcolor = color1)
ax2.tick_params(axis = 'y', labelcolor = color1)

fig.legend(loc='upper right', bbox_to_anchor=(0.85, 0.88), ncol=1, fancybox=True, shadow=True)
plt.show()