How to Draw a Scatter Plot Diagram Using Scatter() Method in Python


In this example we will show how to draw a scatter plot diagram using the scatter() method in Python.

Source Code

import matplotlib.pyplot as plt

x = [14.4, 16.5, 11.9, 15.4, 18.6, 22.2, 19.5, 25.3, 23.4, 18.2, 22.6, 17.4]
y = [225, 334, 192, 339, 411, 530, 418, 623, 551, 430, 452, 416]

plt.scatter(x, y)
plt.show()

Output:

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments