#!/usr/bin/env python

import numpy as np
import sys
import matplotlib.pyplot as plt

text_files = np.delete(np.array(sys.argv), 0)

for text_file in text_files:
    try:
        data = np.loadtxt(text_file, delimiter=',')
    except IOError as e:
        print(e)
    else:
        x_axis = data[:,0]
        y_axis = data[:,1]
        plt.plot(x_axis, y_axis, label=text_file)
        plt.legend()
plt.show()