np linspace 28 29 in python

Solutions on MaxInterview for np linspace 28 29 in python by the best coders in the world

showing results for - "np linspace 28 29 in python"
Julia
13 Jul 2017
1>>> import matplotlib.pyplot as plt
2>>> N = 8
3>>> y = np.zeros(N)
4>>> x1 = np.linspace(0, 10, N, endpoint=True)
5>>> x2 = np.linspace(0, 10, N, endpoint=False)
6>>> plt.plot(x1, y, 'o')
7[<matplotlib.lines.Line2D object at 0x...>]
8>>> plt.plot(x2, y + 0.5, 'o')
9[<matplotlib.lines.Line2D object at 0x...>]
10>>> plt.ylim([-0.5, 1])
11(-0.5, 1)
12>>> plt.show()
13