2

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?

1 Answers1

3

Use the label parameter

df = pd.DataFrame(np.random.rand(10, 2), columns=['x', 'y'])

df.plot.scatter('x', 'y', label='x')

enter image description here

piRSquared
  • 285,575
  • 57
  • 475
  • 624