Reputation: 47
I have plotted a scatter graph that takes two columns from a table using:
df.plot.scatter("volume/mm^3", "Cost per m^3/$")
plt.title("Volume vs. Cost Analysis", size = 16)
plt.ylim((0,80000))
plt.xlim((7500,30000))
I am now trying to either annotate each point or create a legend using the first column How would I do so?
Upvotes: 2
Views: 76
Reputation: 294198
Use the label
parameter
df = pd.DataFrame(np.random.rand(10, 2), columns=['x', 'y'])
df.plot.scatter('x', 'y', label='x')
Upvotes: 3