Plot the data using pandas and matplotlib

catch the data using pandas package
and change dataframe to array

In [1]:
import matplotlib.pyplot as plt
import numpy as nm
import pandas
%matplotlib inline
df  = pandas.read_csv("Current to Field_01.txt","\t")
data = df.values
data
Out[1]:
array([[ -8.00000000e+00,  -1.14600000e+03],
       [ -7.84000000e+00,  -1.12870000e+03],
       [ -7.68000000e+00,  -1.10660000e+03],
       [ -7.52000000e+00,  -1.08380000e+03],
       [ -7.36000000e+00,  -1.06090000e+03],
       [ -7.20000000e+00,  -1.03790000e+03],
       [ -7.04000000e+00,  -1.01490000e+03],
       [ -6.88000000e+00,  -9.92400000e+02],
       [ -6.72000000e+00,  -9.69300000e+02],
       [ -6.56000000e+00,  -9.46300000e+02],
       [ -6.40000000e+00,  -9.23200000e+02],
       [ -6.24000000e+00,  -9.00000000e+02],
       [ -6.08000000e+00,  -8.76800000e+02],
       [ -5.92000000e+00,  -8.53600000e+02],
       [ -5.76000000e+00,  -8.30400000e+02],
       [ -5.60000000e+00,  -8.07100000e+02],
       [ -5.44000000e+00,  -7.84300000e+02],
       [ -5.28000000e+00,  -7.61000000e+02],
       [ -5.12000000e+00,  -7.37700000e+02],
       [ -4.96000000e+00,  -7.14400000e+02],
       [ -4.80000000e+00,  -6.91000000e+02],
       [ -4.64000000e+00,  -6.67600000e+02],
       [ -4.48000000e+00,  -6.44200000e+02],
       [ -4.32000000e+00,  -6.20800000e+02],
       [ -4.16000000e+00,  -5.97400000e+02],
       [ -4.00000000e+00,  -5.73900000e+02],
       [ -3.84000000e+00,  -5.50900000e+02],
       [ -3.68000000e+00,  -5.27500000e+02],
       [ -3.52000000e+00,  -5.04000000e+02],
       [ -3.36000000e+00,  -4.80500000e+02],
       [ -3.20000000e+00,  -4.57000000e+02],
       [ -3.04000000e+00,  -4.33400000e+02],
       [ -2.88000000e+00,  -4.09900000e+02],
       [ -2.72000000e+00,  -3.86300000e+02],
       [ -2.56000000e+00,  -3.62800000e+02],
       [ -2.40000000e+00,  -3.39700000e+02],
       [ -2.24000000e+00,  -3.16100000e+02],
       [ -2.08000000e+00,  -2.92500000e+02],
       [ -1.92000000e+00,  -2.68900000e+02],
       [ -1.76000000e+00,  -2.45300000e+02],
       [ -1.60000000e+00,  -2.21700000e+02],
       [ -1.44000000e+00,  -1.98080000e+02],
       [ -1.28000000e+00,  -1.74450000e+02],
       [ -1.12000000e+00,  -1.50810000e+02],
       [ -9.60000000e-01,  -1.27170000e+02],
       [ -8.00000000e-01,  -1.03990000e+02],
       [ -6.40000000e-01,  -8.03300000e+01],
       [ -4.80000000e-01,  -5.66600000e+01],
       [ -3.20000000e-01,  -3.29600000e+01],
       [ -1.60000000e-01,  -9.26900000e+00],
       [  0.00000000e+00,   1.44560000e+01],
       [  1.60000000e-01,   3.81600000e+01],
       [  3.20000000e-01,   6.18700000e+01],
       [  4.80000000e-01,   8.51100000e+01],
       [  6.40000000e-01,   1.08800000e+02],
       [  8.00000000e-01,   1.32490000e+02],
       [  9.60000000e-01,   1.56230000e+02],
       [  1.12000000e+00,   1.79950000e+02],
       [  1.28000000e+00,   2.03670000e+02],
       [  1.44000000e+00,   2.27380000e+02],
       [  1.60000000e+00,   2.51100000e+02],
       [  1.76000000e+00,   2.74330000e+02],
       [  1.92000000e+00,   2.98030000e+02],
       [  2.08000000e+00,   3.21800000e+02],
       [  2.24000000e+00,   3.45400000e+02],
       [  2.40000000e+00,   3.69100000e+02],
       [  2.56000000e+00,   3.92800000e+02],
       [  2.72000000e+00,   4.16500000e+02],
       [  2.88000000e+00,   4.39700000e+02],
       [  3.04000000e+00,   4.63400000e+02],
       [  3.20000000e+00,   4.87000000e+02],
       [  3.36000000e+00,   5.10700000e+02],
       [  3.52000000e+00,   5.34300000e+02],
       [  3.68000000e+00,   5.58100000e+02],
       [  3.84000000e+00,   5.81700000e+02],
       [  4.00000000e+00,   6.05400000e+02],
       [  4.16000000e+00,   6.28600000e+02],
       [  4.32000000e+00,   6.52300000e+02],
       [  4.48000000e+00,   6.76000000e+02],
       [  4.64000000e+00,   6.99700000e+02],
       [  4.80000000e+00,   7.23300000e+02],
       [  4.96000000e+00,   7.47000000e+02],
       [  5.12000000e+00,   7.70700000e+02],
       [  5.28000000e+00,   7.94400000e+02],
       [  5.44000000e+00,   8.17700000e+02],
       [  5.60000000e+00,   8.41400000e+02],
       [  5.76000000e+00,   8.65100000e+02],
       [  5.92000000e+00,   8.88700000e+02],
       [  6.08000000e+00,   9.12400000e+02],
       [  6.24000000e+00,   9.36200000e+02],
       [  6.40000000e+00,   9.59800000e+02],
       [  6.56000000e+00,   9.83100000e+02],
       [  6.72000000e+00,   1.00680000e+03],
       [  6.88000000e+00,   1.03060000e+03],
       [  7.04000000e+00,   1.05430000e+03],
       [  7.20000000e+00,   1.07800000e+03],
       [  7.36000000e+00,   1.10170000e+03],
       [  7.52000000e+00,   1.12540000e+03],
       [  7.68000000e+00,   1.14910000e+03],
       [  7.84000000e+00,   1.17230000e+03]])

Get the x-axis and y-axis

In [2]:
x = []
y = []
for i in range(len(data)):
    x.append(data[i][0])
    y.append(data[i][1])

show x data

In [3]:
x
Out[3]:
[-8.0,
 -7.8399999999999999,
 -7.6799999999999997,
 -7.5199999999999996,
 -7.3600000000000003,
 -7.2000000000000002,
 -7.04,
 -6.8799999999999999,
 -6.7199999999999998,
 -6.5599999999999996,
 -6.4000000000000004,
 -6.2400000000000002,
 -6.0800000000000001,
 -5.9199999999999999,
 -5.7599999999999998,
 -5.5999999999999996,
 -5.4400000000000004,
 -5.2800000000000002,
 -5.1200000000000001,
 -4.96,
 -4.7999999999999998,
 -4.6399999999999997,
 -4.4800000000000004,
 -4.3200000000000003,
 -4.1600000000000001,
 -4.0,
 -3.8399999999999999,
 -3.6800000000000002,
 -3.52,
 -3.3599999999999999,
 -3.2000000000000002,
 -3.04,
 -2.8799999999999999,
 -2.7200000000000002,
 -2.5600000000000001,
 -2.3999999999999999,
 -2.2400000000000002,
 -2.0800000000000001,
 -1.9199999999999999,
 -1.76,
 -1.6000000000000001,
 -1.4399999999999999,
 -1.28,
 -1.1200000000000001,
 -0.95999999999999996,
 -0.80000000000000004,
 -0.64000000000000001,
 -0.47999999999999998,
 -0.32000000000000001,
 -0.16,
 0.0,
 0.16,
 0.32000000000000001,
 0.47999999999999998,
 0.64000000000000001,
 0.80000000000000004,
 0.95999999999999996,
 1.1200000000000001,
 1.28,
 1.4399999999999999,
 1.6000000000000001,
 1.76,
 1.9199999999999999,
 2.0800000000000001,
 2.2400000000000002,
 2.3999999999999999,
 2.5600000000000001,
 2.7200000000000002,
 2.8799999999999999,
 3.04,
 3.2000000000000002,
 3.3599999999999999,
 3.52,
 3.6800000000000002,
 3.8399999999999999,
 4.0,
 4.1600000000000001,
 4.3200000000000003,
 4.4800000000000004,
 4.6399999999999997,
 4.7999999999999998,
 4.96,
 5.1200000000000001,
 5.2800000000000002,
 5.4400000000000004,
 5.5999999999999996,
 5.7599999999999998,
 5.9199999999999999,
 6.0800000000000001,
 6.2400000000000002,
 6.4000000000000004,
 6.5599999999999996,
 6.7199999999999998,
 6.8799999999999999,
 7.04,
 7.2000000000000002,
 7.3600000000000003,
 7.5199999999999996,
 7.6799999999999997,
 7.8399999999999999]

You can also check y, too.
But, we don't print it here.

In [4]:
ax = plt.subplot(111)
plt.plot(x,y,'-bo', markersize = 1, linewidth = 0.5)
ax.set(xlabel='Current (A)', ylabel='Field (G)', title='Test')
plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=1.0)
ax.grid()
plt.show
Out[4]:
<function matplotlib.pyplot.show>