In [1]:
import matplotlib.pyplot as plt
x = [1, 2, 1.5, 4, 5]
y = [10,11,13,18,20]
plt.scatter(x, y)
plt.xlabel(''''X'''')
plt.ylabel(''''Y'''')
plt.title(''''Scatter Plot'''')
plt.show()
In [2]:
import matplotlib.pyplot as plt
x1 = [1, 2, 3, 4, 5]
y1 = [2, 3, 5, 7, 11]
x2 = [1, 2, 3, 4, 5]
y2 = [1, 4, 6, 8, 10]
x3 = [1, 2, 3, 4, 5]
y3 = [3, 5, 7, 9, 12]
plt.scatter(x1, y1, label=''''Series 1'''', color=''''r'''', marker=''''o'''')
plt.scatter(x2, y2, label=''''Series 2'''', color=''''g'''', marker=''''x'''')
plt.scatter(x3, y3, label=''''Series 3'''', color=''''b'''', marker=''''s'''')
plt.title(''''Scatter Plot with Multiple Series'''')
plt.xlabel(''''X-axis'''')
plt.ylabel(''''Y-axis'''')
plt.legend()
plt.show()