I am looking for an alternative way of plotting data points on the chart.
Let's say I have the following dataframe:
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.DataFrame({'x':np.random.rand(10), 'y':np.random.rand(10)})
I would like to see on the chart the y values above each the data point.
Here the version of @tozCSS, which works fine.
ax = df.plot(kind='line',x='x',y='y')
df[['x','y','y']].apply(lambda row: ax.text(*row),axis=1)
The code below outputs the index as a value on the chart, is there a way to edit it so the y values are output:
ax = df.plot('x', 'y', kind='line')
for k, v in df.iterrows():
ax.annotate(k, v)