.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Markers/plot_horizontal_lines.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_Markers_plot_horizontal_lines.py: Horizontal Lines ================ Draw static horizontal threshold lines on a 1-D plot with :meth:`~anyplotlib.figure_plots.Plot1D.add_hlines`. Use ``markers["hlines"]["name"].set(...)`` to update them live. .. GENERATED FROM PYTHON SOURCE LINES 9-24 .. code-block:: Python import numpy as np import anyplotlib as vw x = np.linspace(0, 4 * np.pi, 512) signal = np.sin(x) fig, ax = vw.subplots(1, 1, figsize=(560, 300)) v = ax.plot(signal, axes=[x], units="rad") v.add_hlines([0.5, 0.0, -0.5], name="thresholds", color="#69f0ae", linewidths=1.5, label="thresholds", labels=["+0.5", "zero", "-0.5"]) fig .. raw:: html
.. GENERATED FROM PYTHON SOURCE LINES 25-27 Live update ----------- .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: Python v.markers["hlines"]["thresholds"].set(color="#ff1744", linewidths=2.0) fig .. raw:: html
.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.041 seconds) .. _sphx_glr_download_auto_examples_Markers_plot_horizontal_lines.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_horizontal_lines.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_horizontal_lines.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_horizontal_lines.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_