.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/heaviside.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__auto_examples_heaviside.py: Heaviside Step Function ===================================== :func:`sysplot.heaviside` evaluates the Heaviside step function over a NumPy array. It returns 0 for negative inputs and 1 for positive inputs. The value at exactly ``x = 0`` is controlled by the ``default_value`` parameter, which is set to ``1``. .. GENERATED FROM PYTHON SOURCE LINES 8-22 .. image-sg:: /_auto_examples/images/sphx_glr_heaviside_001.png :alt: Heaviside step function :srcset: /_auto_examples/images/sphx_glr_heaviside_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt import sysplot as ssp ssp.apply_config() x = np.linspace(-3, 3, 600) # Uses default_value from SysplotConfig (default: 1.0) fig, ax = plt.subplots(figsize=ssp.get_figsize()) ax.plot(x, ssp.heaviside(x)) ax.set(title="Heaviside step function", xlabel="x", ylabel="σ(x)") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.217 seconds) .. _sphx_glr_download__auto_examples_heaviside.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: heaviside.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: heaviside.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: heaviside.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_