diff --git a/DivergingPlot_Panelists.py b/DivergingPlot_Panelists.py index 719bd45..1469269 100644 --- a/DivergingPlot_Panelists.py +++ b/DivergingPlot_Panelists.py @@ -7,236 +7,282 @@ # Very_Good = [62.5,25.0,50.0,32.1,50.0,19.6] # Excellent =[12.5,23.2,25.0,25.0,12.5,19.6] -# Poor =1 Fair =2 Satisfactory =3 Very good =4 Excellent=5 +# Poor =1 Fair =2 Satisfactory =3 Very good =4 Excellent=5 # Control Clerity of Codebase of regular developement 10.7 21.4 28.6 19.6 19.6 -# Simplicity of Codebase of regular developement 8.9 12.5 30.4 25.0 23.2 -# Consistency of Codebase of regular developement 12.5 12.5 17.9 32.1 25.0 # Microasking Clerity of codebase of microtask programming 0.0 0.0 37.5 50.0 12.5 + +# Simplicity of Codebase of regular developement 8.9 12.5 30.4 25.0 23.2 # Simplicity of codebase of microtask programming 0.0 25.0 0.0 62.5 12.5 + +# Consistency of Codebase of regular developement 12.5 12.5 17.9 32.1 25.0 # Consistency of codebase of microtask programming 12.5 12.5 0.0 50.0 25.0 +# { "order": 1, +# "question": "-", +# "type": "Poor", +# "value": 0, +# "percentage": 0, +# "percentage_start": 0, +# "percentage_end": 0 +# }, +# { "order": 1, +# "question": "-", +# "type": "Fair", +# "value": 0, +# "percentage": 0, +# "percentage_start": 0, +# "percentage_end": 0 +# }, +# { "order": 1, +# "question": "-", +# "type": "Satisfactory", +# "value": 0, +# "percentage": 0, +# "percentage_start": 0, +# "percentage_end": 0 +# }, +# { "order": 1, +# "question": "-", +# "type": "Very Good", +# "value": 0, +# "percentage": 0, +# "percentage_start": 0, +# "percentage_end": 0 +# }, +# { "order": 1, +# "question": "-", +# "type": "Excellent", +# "value": 0, +# "percentage": 0, +# "percentage_start": 0, +# "percentage_end": 0 +# }, + source = alt.pd.DataFrame([ - { + + { "order": 1, "question": "Clarity (C)", "type": "Poor", - "value": 0, - "percentage": 0, - "percentage_start": 0, - "percentage_end": 0 + "value": 10.7, + "percentage": 10.7, + "percentage_start": -32.1, + "percentage_end": -21.4 }, - { + { "order": 1, "order": 1, "question": "Clarity (C)", "type": "Fair", - "value": 0, - "percentage": 0, - "percentage_start": 0, + "value": 21.4, + "percentage": 21.4, + "percentage_start": -21.4, "percentage_end": 0 }, - { + { "order": 1, "order": 1, "question": "Clarity (C)", "type": "Satisfactory", - "value": 1, - "percentage": 16, - "percentage_start": -8, - "percentage_end": 8 + "value": 28.6, + "percentage":28.6, + "percentage_start": 0, + "percentage_end": 28.6 }, - { + { "order": 1, "question": "Clarity (C)", "type": "Very Good", - "value": 5, - "percentage": 83, - "percentage_start": 8, - "percentage_end": 91 + "value": 19.6, + "percentage": 19.6, + "percentage_start": 28.6, + "percentage_end": 48.2 }, - { + { "order": 1, "question": "Clarity (C)", "type": "Excellent", - "value": 0, - "percentage": 0, - "percentage_start": 91, - "percentage_end": 91 + "value": 19.6, + "percentage": 19.6, + "percentage_start": 48.2, + "percentage_end": 67.8 }, - { + { "order": 1, "question": "Clarity (E)", "type": "Poor", - "value": 1, - "percentage": 16, - "percentage_start": -49, - "percentage_end": -33 + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 }, - { + { "order": 1, "question": "Clarity (E)", "type": "Fair", "value": 0, "percentage": 0, - "percentage_start": -33, - "percentage_end": -33 + "percentage_start": 0, + "percentage_end": 0 }, - { + { "order": 1, "question": "Clarity (E)", "type": "Satisfactory", - "value": 4, - "percentage": 66, - "percentage_start": -33, - "percentage_end": 33 + "value": 37.5, + "percentage": 37.5, + "percentage_start": 0, + "percentage_end": 37.5 }, - { + { "order": 1, "question": "Clarity (E)", "type": "Very Good", - "value": 0, - "percentage": 0, - "percentage_start": 33, - "percentage_end": 33 + "value": 50, + "percentage": 50, + "percentage_start": 37.5, + "percentage_end": 87.5 }, - { + { "order": 1, "question": "Clarity (E)", "type": "Excellent", - "value": 1, - "percentage": 16, - "percentage_start": 33, - "percentage_end": 49 + "value": 12.5, + "percentage": 12.5, + "percentage_start": 87.5, + "percentage_end": 100 }, - { + + + { "order": 1, "question": "Consistency (C)", "type": "Poor", - "value": 0, - "percentage": 0, - "percentage_start": 0, - "percentage_end": 0 + "value": 12.5, + "percentage": 12.5, + "percentage_start": -12.5, + "percentage_end": -25 }, - { + { "order": 1, "question": "Consistency (C)", "type": "Fair", - "value": 0, - "percentage": 0, + "value": 12.5, + "percentage": 12.5, "percentage_start": 0, - "percentage_end": 0 + "percentage_end": -12.5 }, - { + { "order": 1, "question": "Consistency (C)", "type": "Satisfactory", - "value": 0, - "percentage": 0, + "value": 17.9, + "percentage": 17.9, "percentage_start": 0, - "percentage_end": 0 + "percentage_end": 17.9 }, - { + { "order": 1, "question": "Consistency (C)", "type": "Very Good", - "value": 5, - "percentage": 83, - "percentage_start": 0, - "percentage_end": 83 + "value": 32.1, + "percentage": 32.1, + "percentage_start": 17.9, + "percentage_end": 50 }, - { + { "order": 1, "question": "Consistency (C)", "type": "Excellent", - "value": 1, - "percentage": 17, - "percentage_start": 83, - "percentage_end": 100 + "value": 25, + "percentage": 25, + "percentage_start": 50, + "percentage_end": 75 }, - { + { "order": 2, "question": "Consistency (E)", "type": "Poor", - "value": 1, - "percentage": 17, - "percentage_start": -58, - "percentage_end": -75 + "value": 12.5, + "percentage": 12.5, + "percentage_start": - 12.5, + "percentage_end": -25 }, - { + { "order": 2, "question": "Consistency (E)", "type": "Fair", - "value": 2, - "percentage": 3, - "percentage_start": -58, - "percentage_end": -25 + "value": 12.5, + "percentage": 12.5, + "percentage_start": 0, + "percentage_end": -12.5 }, - { + { "order": 2, "question": "Consistency (E)", "type": "Satisfactory", - "value": 3, - "percentage": 50, - "percentage_start": -25, - "percentage_end": 25 + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 }, - { + { "order": 2, "question": "Consistency (E)", "type": "Very Good", - "value": 0, - "percentage": 0, - "percentage_start": 25, - "percentage_end": 25 + "value": 50, + "percentage": 50, + "percentage_start": 0, + "percentage_end": 50 }, - { + { "order": 2, "question": "Consistency (E)", "type": "Excellent", - "value": 0, - "percentage": 0, - "percentage_start": 25, - "percentage_end": 25 + "value": 25, + "percentage": 25, + "percentage_start": 50, + "percentage_end": 75 }, - { + { "order": 1, "question": "Simplicity (C)", "type": "Poor", - "value": 1, - "percentage": 17, - "percentage_start": 0, - "percentage_end": -17 + "value": 8.9, + "percentage": 8.9, + "percentage_start": -12.5, + "percentage_end": -21.4 }, - { + { "order": 1, "question": "Simplicity (C)", "type": "Fair", - "value": 0, - "percentage": 0, + "value": 12.5, + "percentage": 12.5, "percentage_start": 0, - "percentage_end": 0 + "percentage_end": -12.5 }, - { + { "order": 1, "question": "Simplicity (C)", "type": "Satisfactory", - "value": 0, - "percentage": 0, + "value": 30.4, + "percentage": 30.4, "percentage_start": 0, - "percentage_end": 0 + "percentage_end": 30.4 }, - { + { "order": 1, "question": "Simplicity (C)", "type": "Very Good", - "value": 5, - "percentage": 83, - "percentage_start": 0, - "percentage_end": 83 + "value": 25, + "percentage": 25, + "percentage_start": 30.4, + "percentage_end": 55.4 }, - { + { "order": 1, "question": "Simplicity (C)", "type": "Excellent", - "value": 0, - "percentage": 0, - "percentage_start": 83, - "percentage_end": 83 + "value": 23.2, + "percentage": 23.2, + "percentage_start": 55.4, + "percentage_end":78.6 }, - { + { "order": 1, "question": "Simplicity (E)", "type": "Poor", "value": 0, "percentage": 0, - "percentage_start": -17, - "percentage_end": -17 + "percentage_start": 0, + "percentage_end": 0 }, - { + { "order": 1, "question": "Simplicity (E)", "type": "Fair", - "value": 1, - "percentage": 17, + "value": 25, + "percentage": 25, "percentage_start": 0, - "percentage_end": -17 + "percentage_end": -25 }, - { + { "order": 1, "question": "Simplicity (E)", "type": "Satisfactory", "value": 0, @@ -244,21 +290,21 @@ "percentage_start": 0, "percentage_end": 0 }, - { + { "order": 1, "question": "Simplicity (E)", "type": "Very Good", - "value": 4, - "percentage": 66, + "value": 62.5, + "percentage": 62.5, "percentage_start": 0, - "percentage_end": 66 + "percentage_end": 62.5 }, - { + { "order": 1, "question": "Simplicity (E)", "type": "Excellent", - "value": 1, - "percentage": 17, - "percentage_start": 66, - "percentage_end": 83 + "value": 12.5, + "percentage": 12.5, + "percentage_start": 62.5, + "percentage_end": 75 } ]) @@ -270,28 +316,16 @@ "Very Good", "Excellent" ], - range=["#c30d24", "#f3a583", "#cccccc", "#94c6da", "#1770ab"] + range=["#ff6361", "#ffa600", "#bc5090", "#58508d", "#003f5c"] ) -y_axis = alt.Axis( - title='', - offset=5, - ticks=False, - minExtent=60, - domain=False -) +y_axis = alt.Axis( title='', offset=5, ticks=False, minExtent=60, domain=False) -chart =alt.Chart(source).mark_bar().encode( - x='percentage_start:Q', - x2='percentage_end:Q', - y=alt.Y('question:N', axis=y_axis), - color=alt.Color( - 'type:N', - legend=alt.Legend(title='Response',orient='top'), - scale=color_scale, - ) -).configure_view(strokeWidth=0) +chart =alt.Chart(source,width=600,height=300).mark_bar().encode(x='percentage_start:Q',x2='percentage_end:Q', y=alt.Y('question:N', axis=y_axis), + color=alt.Color( 'type:N', legend=alt.Legend(title='',orient='top'), scale=color_scale, + )).properties(title='Quality of code of control (C) and experimental (E) groups').configure_view(strokeWidth=0) + # .configure_axis(labelFontSize=20, titleFontSize=20).configure_title(fontSize=20) chart.show() # chart.save('filename.pdf') \ No newline at end of file diff --git a/DivergingStackedBar_QOS.py b/DivergingStackedBar_QOS.py index d540a31..f97396a 100644 --- a/DivergingStackedBar_QOS.py +++ b/DivergingStackedBar_QOS.py @@ -270,7 +270,7 @@ ) -chart =alt.Chart(source).mark_bar().encode( +chart =alt.Chart(source,width=600,height=300).mark_bar().encode( x='percentage_start:Q', x2='percentage_end:Q', y=alt.Y('question:N', axis=y_axis), diff --git a/Onboarding.py b/Onboarding.py index 65a6889..49c936c 100644 --- a/Onboarding.py +++ b/Onboarding.py @@ -15,25 +15,26 @@ FirstLOCWidth = np.add(tutorial, training_task).tolist() firstTaskWidth = np.add(first_loc, FirstLOCWidth).tolist() # careful: notice "bottom" parameter became "left" - +# plt.figure(figsize=(5,7)) p0 = plt.barh(participants, training_task, color="#ffa600") p1 = plt.barh(participants, tutorial,left=training_task, color="#ff6361") p2 = plt.barh(participants, first_loc, left=FirstLOCWidth, color="#58508d") p3 = plt.barh(participants, first_task, left=firstTaskWidth, color="#003f5c") # we also need to switch the labels 003f5c -plt.xlabel('Time in minutes') +plt.xlabel('Time in minutes', fontsize=12) # plt.ylabel('Participants of controlled(Ci) and experimental(Ei) groups') plt.legend((p0[0],p1[0], p2[0], p3[0]), ('Training task', '\n'.join(wrap('Beginning of session until starting the first task', 25)), '\n'.join(wrap('Start first task/issue until writing first LOC', 25)), '\n'.join(wrap('Start first task/issue until finishing it', 25)) - )) -plt.title('Onboarding time of control(Ci) and experimental(Ei) participants') -plt.subplots_adjust(left=0.15, right=0.96, top=0.95, bottom=0.1) + ), fontsize=11) +plt.title( 'Onboarding time of control(Ci) and experimental(Ei) participants', fontsize=13) +plt.subplots_adjust(left=0.19, right=0.89, top=0.87, bottom=0.1) # remove the frame plt.gca().spines['right'].set_visible(False) plt.gca().spines['top'].set_visible(False) +# plt.figure(figsize=(5,5)) diff --git a/QOC.py b/QOC.py index aeb7952..e91cd5c 100644 --- a/QOC.py +++ b/QOC.py @@ -27,7 +27,7 @@ # plt.ylabel('Participants of controlled(Ci) and experimental(Ei) groups') plt.legend((p1[0], p2[0],p3[0],p4[0],p5[0]), ('Poor', 'Fairs','Satisfactory','Very Good','Excellent'),loc='lower left', bbox_to_anchor=(0,1.02,1, 0.2),mode='expand',ncol=5,borderaxespad=0) -plt.title('Quality of code by control (C) and experimental (E) groups',y=1.09) +plt.title('Quality of code of control (C) and experimental (E) groups',y=1.09) plt.subplots_adjust(left=0.1, right=0.9, top=0.9, bottom=0.1) plt.gca().spines['right'].set_visible(False) plt.gca().spines['top'].set_visible(False) diff --git a/SVGtoPDF.py b/SVGtoPDF.py index d479f60..e6558d2 100644 --- a/SVGtoPDF.py +++ b/SVGtoPDF.py @@ -2,5 +2,7 @@ from reportlab.graphics import renderPDF, renderPM -drawing = svg2rlg("./data/visualization_1.svg") -renderPDF.drawToFile(drawing, "./data/QuestionVisualized.pdf") \ No newline at end of file +drawing = svg2rlg("./data/Panelists.svg") +renderPDF.drawToFile(drawing, "./data/Panelists2.pdf") +# drawing = svg2rlg("./data/Qos.svg") +# renderPDF.drawToFile(drawing, "./data/Qos.pdf") \ No newline at end of file diff --git a/data/Panelists.pdf b/data/Panelists.pdf new file mode 100644 index 0000000..554d208 Binary files /dev/null and b/data/Panelists.pdf differ diff --git a/data/Panelists.svg b/data/Panelists.svg new file mode 100644 index 0000000..18786d2 --- /dev/null +++ b/data/Panelists.svg @@ -0,0 +1 @@ +-40-30-20-100102030405060708090100percentage_start, percentage_endClarity (C)Clarity (E)Consistency (C)Consistency (E)Simplicity (C)Simplicity (E)PoorFairSatisfactoryVery GoodExcellentQuality of code of control (C) and experimental (E) groups \ No newline at end of file diff --git a/data/Panelists2.pdf b/data/Panelists2.pdf new file mode 100644 index 0000000..7ad7c50 Binary files /dev/null and b/data/Panelists2.pdf differ diff --git a/data/Qos.pdf b/data/Qos.pdf new file mode 100644 index 0000000..2073c14 Binary files /dev/null and b/data/Qos.pdf differ diff --git a/data/Qos.svg b/data/Qos.svg new file mode 100644 index 0000000..fd84814 --- /dev/null +++ b/data/Qos.svg @@ -0,0 +1 @@ +-80-70-60-50-40-30-20-100102030405060708090100percentage_start, percentage_endQuestion 1Question 2Question 3Question 4Question 5Question 6QuestionStrongly disagreeDisagreeNeither agree nor disagreeAgreeStrongly agreeResponse \ No newline at end of file diff --git a/data/onboading.pdf b/data/onboading.pdf index 647aaa4..42fca28 100644 Binary files a/data/onboading.pdf and b/data/onboading.pdf differ