scatter plt.plot python pandas code example
Example 1: how to plot a scatter plot in matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
plt.figure(figsize=(10,6))
plt.scatter(x, y, label = "label_name" )
plt.xlabel('X Values')
plt.ylabel('Y Values')
plt.title('Scatter Title')
plt.legend()
plt.show()
Example 2: matplotlib scatter
import matplotlib.pyplot as plt
%matplotlib inline
fig, ax = plt.subplots()
ax.scatter(x, y)
ax.set_title("Title")
ax.set_xlabel("X_Label")
ax.set_ylabel("Y_Label")