Answers for "python scatter plot with data labels"

3

scatter plot of a dataframe in python

>>> ax2 = df.plot.scatter(x='length',
...                       y='width',
...                       c='species',
...                       colormap='viridis')
Posted by: Guest on December-17-2020
0

how to label points in scatter plot in python

y = [2.56422, 3.77284, 3.52623, 3.51468, 3.02199]
z = [0.15, 0.3, 0.45, 0.6, 0.75]
n = [58, 651, 393, 203, 123]

fig, ax = plt.scatter(z, y)

for i, txt in enumerate(n):
    ax.annotate(txt, (z[i], y[i]))
Posted by: Guest on March-10-2021

Code answers related to "python scatter plot with data labels"

Python Answers by Framework

Browse Popular Code Answers by Language