.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Markers/plot_vertical_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_vertical_lines.py: Vertical Lines ============== Draw static vertical marker lines on a 1-D plot with :meth:`~anyplotlib.figure_plots.Plot1D.add_vlines`. Use ``markers["vlines"]["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_vlines([np.pi, 2 * np.pi, 3 * np.pi], name="pi_mult", color="#00e5ff", linewidths=1.5, label="pi multiples", labels=["\u03c0", "2\u03c0", "3\u03c0"]) fig .. raw:: html
.. GENERATED FROM PYTHON SOURCE LINES 25-27 Live update ----------- .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: Python v.markers["vlines"]["pi_mult"].set(color="#ff9100", linewidths=2.0) fig .. raw:: html
.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.040 seconds) .. _sphx_glr_download_auto_examples_Markers_plot_vertical_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_vertical_lines.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_vertical_lines.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_vertical_lines.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_