Something went wrong. Try again.
A research project I did in my junior year of college, published in the Journal of Computing Sciences in Colleges, Volume 39, Issue 4. dl.acm.org/doi/10.5555/3637036.3637039
Something went wrong. Try again.
mauth-research-project plot.py
1234567891011121314151617181920212223242526272829303132import numpy as npimport pandas as pdfrom matplotlib import pyplot as plt
def main(): # to view a certain subjects data, update this value to the desired subject ID subject = 5 file = f"raw_data/user_{subject}_data.csv" # ID,Timestamp,X,Y,Button,Duration dataframe = pd.read_csv(file, skiprows=1, names=["ID", "Timestamp", "X", "Y", "Button", "Duration"], usecols=['Timestamp', 'X', 'Y'])
# We want to iterate over each time stamp, and plot the values dataframe.set_index("Timestamp", inplace=True)
# Split the dataframe into a 2 x n array, and deconstruct those arrays into x's and y's x, y = np.hsplit(dataframe, 2)
# label the plot and set the title plt.xlabel('Screen x-coordinates') plt.ylabel('Screen y-coordinates') plt.title(f"User {subject}'s mouse path") # plot the data plt.plot(x, y, color='#118ab2') # load the plot plt.show()
if __name__ == '__main__': main()