# Program 5: Display a scatter chart for the points
# (2, 5), (9, 10), (8, 3), (5, 7), (6, 18)

import matplotlib.pyplot as plt

x = [2, 9, 8, 5, 6]
y = [5, 10, 3, 7, 18]

plt.scatter(x, y, color="red", s=80)
for i in range(len(x)):
    # Write each point's coordinates beside it.
    plt.text(x[i] + 0.15, y[i] + 0.3, "(" + str(x[i]) + ", " + str(y[i]) + ")")
plt.title("Scatter chart")
plt.xlabel("x axis")
plt.ylabel("y axis")
plt.grid(True)
plt.show()

print("Points plotted:", len(x))
print("Highest point :", "(" + str(x[y.index(max(y))]) + ", " + str(max(y)) + ")")
