#!/usr/bin/env python3 import matplotlib.pyplot as plt x = [] y = [] with open('test') as fin: for line in fin.read().splitlines(): x_, y_ = list(map(int, line.strip().split(','))) x.append(x_) y.append(y_) plt.plot(x, y) plt.xlabel('x') plt.ylabel('y') plt.show()