.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Widgets/plot_widget2d_annular.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_widget2d_annular.py: 2D Annular Widget ================== A draggable annular (ring) overlay for selecting a radial band on a 2-D image. Drag the inner or outer ring to adjust the radii. .. GENERATED FROM PYTHON SOURCE LINES 8-22 .. raw:: html
.. code-block:: Python import numpy as np import anyplotlib as vw rng = np.random.default_rng(2) data = rng.standard_normal((128, 128)).cumsum(0).cumsum(1) data = (data - data.min()) / (data.max() - data.min()) xy = np.linspace(0, 10, 128) fig, ax = vw.subplots(1, 1, figsize=(460, 460)) v = ax.imshow(data, axes=[xy, xy], units="nm") v.add_widget("annular", color="#00e5ff", cx=64, cy=64, r_outer=40, r_inner=20) fig .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.029 seconds) .. _sphx_glr_download_auto_examples_Widgets_plot_widget2d_annular.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_widget2d_annular.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_widget2d_annular.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_widget2d_annular.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_