.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/scatter/scatter_validate.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_scatter_scatter_validate.py: Scatter validation ================== Example that shows some scatter plot features for test validation. .. GENERATED FROM PYTHON SOURCE LINES 7-77 .. image-sg:: /_gallery/scatter/images/sphx_glr_scatter_validate_001.webp :alt: scatter validate :srcset: /_gallery/scatter/images/sphx_glr_scatter_validate_001.webp :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/fastplotlib/fastplotlib/fastplotlib/graphics/features/_base.py:18: UserWarning: casting float64 array to float32 warn(f"casting {array.dtype} array to float32") | .. code-block:: Python # test_example = true import numpy as np import fastplotlib as fpl import imageio.v3 as iio xs = np.linspace(0, 2 * np.pi, 10) # make sine and cosine data sine = np.column_stack([xs, np.sin(xs)]) cosine = np.column_stack([xs, np.cos(xs)]) # a simple image to display as the points array = np.array([ [1, 0, 1], [0, 1, 0], [1, 1, 1], ]) # load an image of Almar's cat wikkie = np.flipud(iio.imread("imageio:wikkie.png")) figure = fpl.Figure( size=(700, 560) ) figure[0, 0].add_scatter(sine) # combinations of per-point markers, colors and edge colors figure[0, 0].add_scatter( sine, colors=["magenta"] * 3 + ["cyan"] * 3 + ["yellow"] * 3 + ["purple"], uniform_edge_color=False, edge_colors=["w"] * 3 + ["orange"] * 3 + ["blue"] * 3 + ["green"], markers=list("osD+x^v<>*"), edge_width=2.0, sizes=20, uniform_size=True, ) # per-point rotations figure[0, 0].add_scatter( sine, markers="^", sizes=20, point_rotation_mode="vertex", point_rotations=xs, uniform_size=True, offset=(0, 1, 0) ) # point sizes figure[0, 0].add_scatter( sine, markers="s", sizes=xs * 5, offset=(0, 2, 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.620 seconds) .. _sphx_glr_download__gallery_scatter_scatter_validate.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: scatter_validate.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: scatter_validate.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_