0
$\begingroup$

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:
enter image description here
How can I configure the axis so all samples are clearly visible?

$\endgroup$

    1 Answer 1

    0
    $\begingroup$

    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

    $\endgroup$

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.