The program was crashing because it was trying to draw a vertical line for every point in my dataset which is relatively large. By calling the lineplot without the estimator it now works. Solution from other thread:
Estimator in lineplot