linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0)
Returns :None:None:`num` evenly spaced samples, calculated over the interval [`start`, :None:None:`stop`].
The endpoint of the interval can optionally be excluded.
Non-scalar :None:None:`start` and :None:None:`stop` are now supported.
Values are rounded towards -inf
instead of 0
when an integer dtype
is specified. The old behavior can still be obtained with np.linspace(start, stop, num).astype(int)
The starting value of the sequence.
The end value of the sequence, unless :None:None:`endpoint` is set to False. In that case, the sequence consists of all but the last of num + 1
evenly spaced samples, so that :None:None:`stop` is excluded. Note that the step size changes when :None:None:`endpoint` is False.
Number of samples to generate. Default is 50. Must be non-negative.
If True, :None:None:`stop` is the last sample. Otherwise, it is not included. Default is True.
If True, return (:None:None:`samples`, :None:None:`step`), where :None:None:`step` is the spacing between samples.
The type of the output array. If dtype
is not given, the data type is inferred from :None:None:`start` and :None:None:`stop`. The inferred dtype will never be an integer; :None:None:`float` is chosen even if the arguments would produce an array of integers.
The axis in the result to store the samples. Relevant only if start or stop are array-like. By default (0), the samples will be along a new axis inserted at the beginning. Use -1 to get an axis at the end.
There are :None:None:`num` equally spaced samples in the closed interval [start, stop]
or the half-open interval [start, stop)
(depending on whether :None:None:`endpoint` is True or False).
Only returned if :None:None:`retstep` is True
Size of spacing between samples.
Return evenly spaced numbers over a specified interval.
arange
Similar to :None:None:`linspace`, but uses a step size (instead of the number of samples).
geomspace
Similar to :None:None:`linspace`, but with numbers spaced evenly on a log scale (a geometric progression).
logspace
Similar to :None:None:`geomspace`, but with the end points specified as logarithms.
>>> np.linspace(2.0, 3.0, num=5) array([2. , 2.25, 2.5 , 2.75, 3. ])
>>> np.linspace(2.0, 3.0, num=5, endpoint=False) array([2. , 2.2, 2.4, 2.6, 2.8])
>>> np.linspace(2.0, 3.0, num=5, retstep=True) (array([2. , 2.25, 2.5 , 2.75, 3. ]), 0.25)
Graphical illustration:
>>> import matplotlib.pyplot as plt
... N = 8
... y = np.zeros(N)
... x1 = np.linspace(0, 10, N, endpoint=True)
... x2 = np.linspace(0, 10, N, endpoint=False)
... plt.plot(x1, y, 'o') [<matplotlib.lines.Line2D object at 0x...>]
>>> plt.plot(x2, y + 0.5, 'o') [<matplotlib.lines.Line2D object at 0x...>]
>>> plt.ylim([-0.5, 1]) (-0.5, 1)
>>> plt.show()

The following pages refer to to this document either explicitly or contain code examples using this.
scipy.signal.exponentialscipy.signal.windows._windows.boxcarscipy.signal._wavelets.morlet2scipy.interpolate._polyint.krogh_interpolatescipy.linalg._decomp_svd.svdvalsscipy.signal.bartlettscipy.signal._bsplines.cspline1d_evalscipy.interpolate._bsplines.make_lsq_splinescipy.interpolate._bspl.evaluate_all_bsplscipy.integrate._quadrature.newton_cotesscipy.signal.windows._windows.barthannscipy.signal.chebwinscipy.signal._czt.CZTscipy.spatial.transform._rotation_spline.RotationSplinescipy.signal.boxcarscipy.interpolate._polyint.barycentric_interpolatescipy.signal._arraytools.even_extscipy.signal._signaltools.lfilterscipy.signal.windows._windows.hannscipy.signal._waveforms.squarescipy.signal._bsplines.cspline1dscipy.signal._signaltools.detrendscipy.interpolate._fitpack2.SmoothSphereBivariateSplinescipy.signal._peak_finding.peak_widthsscipy.signal._ltisys.lsim2scipy.optimize._optimize.rosenscipy.signal.blackmanharrisscipy.interpolate._polyint.approximate_taylor_polynomialscipy.signal._signaltools.resample_polyscipy.integrate._quadrature.cumulative_trapezoidscipy.integrate._quad_vec.quad_vecscipy.signal.windows._windows.chebwinscipy.signal.parzenscipy.signal._waveforms.sweep_polyscipy.signal.barthannscipy.interpolate._bsplines.make_interp_splinescipy.signal.windows._windows.general_cosinescipy.signal._czt.zoom_fftscipy.signal.flattopscipy.signal.windows._windows.triangscipy.signal._filter_design.ellipscipy.interpolate._fitpack2.UnivariateSpline.derivativescipy.signal.windows._windows.exponentialscipy.signal._signaltools.filtfiltscipy.signal.windows._windows.blackmanscipy.signal.windows._windows.cosinescipy.signal.gaussianscipy.signal._waveforms.sawtoothscipy.interpolate._fitpack2.UnivariateSplinescipy.signal._filter_design.butterscipy.sparse.linalg._expm_multiply.expm_multiplyscipy.signal.windows._windows.tukeyscipy.interpolate._fitpack_impl.splrepscipy.signal._lti_conversion.cont2discretescipy.signal.hannscipy.signal.tukeyscipy.signal.bohmanscipy.signal._wavelets.cwtscipy.signal.hammingscipy.interpolate._ndgriddata.NearestNDInterpolatorscipy.interpolate._fitpack2.UnivariateSpline.integralscipy.signal.windows._windows.kaiserscipy.signal.cosinescipy.signal._waveforms.chirpscipy.interpolate._fitpack2.UnivariateSpline.derivativesscipy.signal._bsplines.qspline1dscipy.signal._ltisys.lsimscipy.signal._signaltools.resamplescipy.interpolate._bsplines.BSplinescipy.linalg._basic.lstsqscipy.interpolate._polyint.KroghInterpolatorscipy.interpolate._fitpack_py.insertscipy.interpolate._interpolate.RegularGridInterpolatorscipy.spatial._geometric_slerp.geometric_slerpscipy.signal._spectral_py.lombscarglescipy.interpolate._fitpack2.LSQUnivariateSplinescipy.signal._signaltools.sosfiltfiltscipy.interpolate._fitpack2.RectSphereBivariateSplinescipy.signal._bsplines.qspline1d_evalscipy.signal._signaltools.decimatescipy.signal.windows._windows.taylorscipy.signal.windows._windows.bartlettscipy.interpolate._interpolate.interpnscipy.signal.triangscipy.interpolate._fitpack_impl.splantiderscipy.interpolate._fitpack2.InterpolatedUnivariateSplinescipy.optimize._optimize.bracketscipy.signal.windows._windows.bohmanscipy.signal._arraytools.odd_extscipy.signal._czt.ZoomFFTscipy.signal._ltisys.place_polesscipy.optimize._minpack_py.curve_fitscipy.interpolate._fitpack_impl.splderscipy.spatial._qhull.HalfspaceIntersectionscipy.interpolate._fitpack_py.splantiderscipy.interpolate._cubic.pchip_interpolatescipy.signal.blackmanscipy.signal.windows._windows.nuttallscipy.signal.windows._windows.general_gaussianscipy.signal.windows._windows.gaussianscipy.signal.windows._windows.flattopscipy.special._orthogonal.gegenbauerscipy.interpolate._rbf.Rbfscipy.signal._waveforms.gausspulsescipy.interpolate._fitpack2.UnivariateSpline.antiderivativescipy.interpolate._fitpack_py.splderscipy.signal._peak_finding.find_peaksscipy.signal.windows._windows.general_hammingscipy.special._basic.diricscipy.signal.kaiserscipy.signal.general_gaussianscipy.signal.windows._windows.parzenscipy.special._ellip_harm.ellip_harmscipy.signal._peak_finding.peak_prominencesscipy.interpolate._fitpack2.LSQSphereBivariateSplinescipy.signal.nuttallscipy.signal._filter_design.cheby1scipy.signal.windows._windows.blackmanharrisscipy.integrate._bvp.solve_bvpscipy.integrate._odepack_py.odeintscipy.signal._arraytools.const_extscipy.integrate._ivp.ivp.solve_ivpscipy.signal._filter_design.cheby2scipy.interpolate._fitpack_py.splrepscipy.interpolate._cubic.CubicSplinescipy.interpolate.interpnd.LinearNDInterpolatorscipy.signal.windows._windows.hammingdask.array.ufunc.wrap_elemwise.<locals>.wrappeddask.array.routines.outerdask.array.routines.piecewisedask.array.ufunc.coshdask.array.ufunc.arccosdask.array.random.RandomState.powerdask.array.random.RandomState.lognormaldask.array.ufunc.sindask.array.routines.histogramdddask.array.creation.meshgriddask.array.ufunc.absolutedask.array.random.RandomState.vonmisesdask.array.ufunc.expdask.array.ufunc.arctanskimage.measure.fit.ransacskimage.exposure.exposure.is_low_contrastskimage.restoration.inpaint.inpaint_biharmonicskimage.measure.fit.CircleModelskimage.measure.fit.EllipseModelskimage.measure.fit.LineModelNDskimage.segmentation.active_contour_model.active_contourHover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them