.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Widgets/plot_widget1d_vline.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_Widgets_plot_widget1d_vline.py: 1D Vertical Line Widget ======================== A draggable vertical line on a 1-D plot panel. Add it with :meth:`~anyplotlib.figure_plots.Plot1D.add_vline_widget`. Drag the line left or right to change the selected x position. .. GENERATED FROM PYTHON SOURCE LINES 9-21 .. raw:: html
.. 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_vline_widget(x=np.pi, color="#e040fb") fig .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.021 seconds) .. _sphx_glr_download_auto_examples_Widgets_plot_widget1d_vline.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_widget1d_vline.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_widget1d_vline.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_widget1d_vline.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_