Plotting timestampt data from CSV using matplotlib
<p>I am trying to plot data from a csv file using matplotlib. There is 1 column against a timestamp:</p>

<pre><code>26-08-2016 00:01    0.062964691
26-08-2016 00:11    0.047209214
26-08-2016 00:21    0.047237823
</code></pre>

<p>I have only been able to create a simple plot using only integers using the code below, which doesn't work when the y data is a timestamp. What do I need to add?
This may seem simple, but I am pressed for time :/ 
thanks!</p>

<pre><code>from matplotlib import pyplot as plt
from matplotlib import style
import numpy as np
import datetime as dt

x,y = np.loadtxt('I112-1.csv',
             unpack=True,
             delimiter = ',')

plt.plot(x,y)

plt.title('Title')
plt.ylabel('Y axis')
plt.xlabel('X axis')

plt.show()
</code></pre>

<p>Here's my example for this problem:</p>

<pre><code>import pandas as pd
from io import StringIO
from datetime import datetime
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt

data_file = StringIO("""
time,value
26-08-2016 00:01,0.062964691
26-08-2016 00:11,0.047209214
26-08-2016 00:21,0.047237823""")

df = pd.read_table(data_file,delimiter=",")

df['datetime']= df.time.map(lambda l: datetime.strptime(l, '%d-%m-%Y %H:%M'))

ax = df.set_index("datetime",drop=False)[['value','datetime']].plot(title="Title",yticks=df.value)
</code></pre>

<p><a href="http://i.stack.imgur.com/rGqBq.png" rel="nofollow"><img src="http://i.stack.imgur.com/rGqBq.png" alt="enter image description here"></a></p>

python csv matplotlib plot