.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/line/inf_line_pairs.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__gallery_line_inf_line_pairs.py: Infinite Lines from Point Pairs =============================== Define infinite lines directly from pairs of points using ``axis=None``. Each two consecutive points define one line. Here pairs of points sampled around the unit circle are used to produce lines that are roughly tangent to the circle. .. GENERATED FROM PYTHON SOURCE LINES 9-34 .. image-sg:: /_gallery/line/images/sphx_glr_inf_line_pairs_001.webp :alt: inf line pairs :srcset: /_gallery/line/images/sphx_glr_inf_line_pairs_001.webp :class: sphx-glr-single-img .. code-block:: Python # test_example = true import fastplotlib as fpl import numpy as np figure = fpl.Figure(size=(700, 560)) # an even number of points sampled around a circle; each consecutive pair of points defines an infinite line t = np.linspace(0, 2 * np.pi, 64, endpoint=False) xs = np.sin(t) ys = np.cos(t) positions = np.column_stack([xs, ys, np.zeros_like(xs)]) figure[0, 0].add_inf_line(positions, axis=None, cmap="hsv", thickness=2) figure[0, 0].axes.intersection = (0, 0, 0) figure.show() # NOTE: fpl.loop.run() should not be used for interactive sessions # See the "JupyterLab and IPython" section in the user guide if __name__ == "__main__": print(__doc__) fpl.loop.run() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.135 seconds) .. _sphx_glr_download__gallery_line_inf_line_pairs.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: inf_line_pairs.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: inf_line_pairs.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_