x = np.random.rand(200) and y = 12 * x - 4 + np.random.randn(200)
After ploting the (x,y) values I get the following graph in matplotlib:
How can I configure the axis so all samples are clearly visible?
1 Answer
$\begingroup$$\endgroup$
You could try the scatter
function.
import matplotlib.pyplot as plt import numpy as np x = np.random.rand(200) y = 12 * x - 4 + np.random.randn(200) plt.plot(x, y, '.') plt.show()
or change the last part
plt.scatter(x, y, marker='o') plt.show()
take a look at some great resources: Jakevdp blog and Matplotlib's own documentation