<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Table of Contents
Preparation
User data vectors
Graphs
Preparation
<a id=preparation />
Step1:  Data vectors of users
<a id=userdatavectors />
Step2:  Graphs
<a id=graphs />
Step3:  Subplot tests
Step4:  Automation tests
Step5:  TODO FIXME
1 column of graphs
graphsProgressBar = FloatProgress(min=0, max=graphsCount)
display(graphsProgressBar)
graphsProgressBar.value = 0
for i in range(0,len(columnAllData.columns))
<ASSISTANT_TASK:>
Python Code:
%run "../Functions/4. User comparison.ipynb"
Explanation: Table of Contents
Preparation
User data vectors
Graphs
Preparation
<a id=preparation />
End of explanation
# small sample
#allData = getAllUserVectorData( getAllUsers()[:10] )
# complete set
#allData = getAllUserVectorData( getAllUsers() )
# subjects which answered the gform
#allData = getAllUserVectorData( getAllResponders()[:10] )
allData = getAllUserVectorData( getAllResponders() )
allData
Explanation: Data vectors of users
<a id=userdatavectors />
End of explanation
columnAllData = allData.T
columnAllData['scorebefore'][:5]
plt.plot(columnAllData['craft'], columnAllData['equip'], 'ro')
plt.xlabel('craft')
plt.ylabel('equip')
plt.plot(columnAllData['sessionsCount'], columnAllData['craft'], 'ro')
plt.xlabel('sessionsCount')
plt.ylabel('craft')
columnAllData.columns
for column in columnAllData.columns:
    print(column)
columnAllData.columns[1]
len(columnAllData.columns)
for i in range(1,len(columnAllData.columns)):
    for j in range(i+1,len(columnAllData.columns)):
        print(i,j)
        print(columnAllData.columns[i], columnAllData.columns[j])
def plotFromAllUsersData(allUsersData, xcolumnname, ycolumnname):
    plt.title("plotting '" + ycolumnname + "' against '" + xcolumnname + "'")
    plt.plot(
                allUsersData[xcolumnname],
                allUsersData[ycolumnname],
                'ro'
            )
    plt.xlabel(xcolumnname)
    plt.ylabel(ycolumnname)
    #plt.show()
plotFromAllUsersData(
                        columnAllData,
                        columnAllData.columns[1],
                        columnAllData.columns[2]
                    )
Explanation: Graphs
<a id=graphs />
End of explanation
plt.figure(1)
#plt.subplot(131)
plt.subplot(311)
plotFromAllUsersData(
                        columnAllData,
                        columnAllData.columns[2],
                        columnAllData.columns[3]
                    )
plt.grid(True)
#plt.subplot(132)
plt.subplot(321)
plotFromAllUsersData(
                        columnAllData,
                        columnAllData.columns[2],
                        columnAllData.columns[4]
                    )
plt.grid(True)
#plt.subplot(133)
plt.subplot(331)
plotFromAllUsersData(
                        columnAllData,
                        columnAllData.columns[2],
                        columnAllData.columns[5]
                    )
plt.grid(True)
plt.subplots_adjust(top=0.92, bottom=0.08, left=0.10, right=0.95, hspace=0.25,
                    wspace=0.35)
plt.show()
fig = plt.figure()
ax1 = fig.add_subplot(221)
ax1.plot([1,2,3,4,5], [10,5,10,5,10], 'r-')
ax2 = fig.add_subplot(222)
ax2.plot([1,2,3,4], [1,4,9,16], 'k-')
ax3 = fig.add_subplot(223)
ax3.plot([1,2,3,4], [1,10,100,1000], 'b-')
ax4 = fig.add_subplot(224)
ax4.plot([1,2,3,4], [0,0,1,1], 'g-')
plt.tight_layout()
fig = plt.gcf()
fig = plt.figure(figsize=(16,4))
ax1 = fig.add_subplot(131)
ax1.plot([1,2,3,4,5], [10,5,10,5,10], 'r-')
ax2 = fig.add_subplot(132)
ax2.plot([1,2,3,4], [1,4,9,16], 'k-')
ax3 = fig.add_subplot(133)
ax3.plot([1,2,3,4], [1,10,100,1000], 'b-')
plt.tight_layout()
fig = plt.gcf()
def subplotFromAllUsersData(ax, allUsersData, xcolumnname, ycolumnname):
    plt.title("'" + str(ycolumnname) + "' against '" + str(xcolumnname) + "'")
    ax.plot(
                allUsersData[xcolumnname],
                allUsersData[ycolumnname],
                'ro'
            )
    plt.xlabel(xcolumnname)
    plt.ylabel(ycolumnname)
    #plt.show()
fig = plt.figure(figsize=(16,4))
ax1 = fig.add_subplot(131)
subplotFromAllUsersData(
                        ax1,
                        columnAllData,
                        columnAllData.columns[2],
                        columnAllData.columns[3]
                    )
ax2 = fig.add_subplot(132)
subplotFromAllUsersData(
                        ax2,
                        columnAllData,
                        columnAllData.columns[2],
                        columnAllData.columns[4]
                    )
ax3 = fig.add_subplot(133)
subplotFromAllUsersData(
                        ax3,
                        columnAllData,
                        columnAllData.columns[2],
                        columnAllData.columns[5]
                    )
plt.tight_layout()
fig = plt.gcf()
for i in range(0,6):
    position = 131 + (i % 3)
    if i % 3 == 0:
        fig = plt.figure(figsize=(16,4))
    ax1 = fig.add_subplot(position)
    subplotFromAllUsersData(
                            ax1,
                            columnAllData,
                            columnAllData.columns[2],
                            columnAllData.columns[3+i]
                        )
Explanation: Subplot tests
End of explanation
len(columnAllData.columns)
graphsCount = len(columnAllData.columns) * (len(columnAllData.columns) - 1) / 2
graphsCount
Explanation: Automation tests
End of explanation
graphsProgressBar = FloatProgress(min=0, max=graphsCount)
display(graphsProgressBar)
graphsProgressBar.value = 0
for i in range(0,len(columnAllData.columns)):
    xcolumnname = columnAllData.columns[i]
    for j in range(i+1,len(columnAllData.columns)):
        ycolumnname = columnAllData.columns[j]
        
        # actual plotting
        position = 131 + (graphsProgressBar.value % 3)
        if graphsProgressBar.value % 3 == 0:
            fig = plt.figure(figsize=(16,4))
        ax = fig.add_subplot(position)
        subplotFromAllUsersData(
                                ax,
                                columnAllData,
                                xcolumnname,
                                ycolumnname
                            )
        
        graphsProgressBar.value += 1
print("done in " + str(graphsProgressBar.value) + " steps.")
Explanation: TODO FIXME
1 column of graphs
graphsProgressBar = FloatProgress(min=0, max=graphsCount)
display(graphsProgressBar)
graphsProgressBar.value = 0
for i in range(0,len(columnAllData.columns)):
    xcolumnname = columnAllData.columns[i]
    for j in range(i+1,len(columnAllData.columns)):
        ycolumnname = columnAllData.columns[j]
        plotFromAllUsersData(columnAllData, xcolumnname, ycolumnname)
        graphsProgressBar.value += 1
print("done in " + str(graphsProgressBar.value) + " steps.")
3 columns of graphs
End of explanation
<END_TASK>