.. note::
    :class: sphx-glr-download-link-note

    Click :ref:`here <sphx_glr_download_auto_examples_viz_markers.py>` to download the full example code
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_viz_markers.py:


======================================================================
Fury Markers
======================================================================

This example shows how to use the marker actor.


.. code-block:: default

    import numpy as np
    from fury import actor, window
    n = 10000







There are nine types 2d markers: circle, square, diamond, triangle, pentagon, 
hexagon, heptagon, cross and plus.


.. code-block:: default


    marker_symbols = ['o', 's', 'd', '^', 'p', 'h', 's6', 'x', '+']
    markers = [
        np.random.choice(marker_symbols)
        for i in range(n)]

    centers = np.random.normal(size=(n, 3), scale=10)

    colors = np.random.uniform(size=(n, 3))







You can control the edge color and edge width for each marker


.. code-block:: default


    nodes_actor = actor.markers(
        centers,
        marker=markers,
        edge_width=.1,
        edge_color=[255, 255, 0],
        colors=colors,
        scales=.5,
    )







In addition, an 3D sphere it's also a valid type of marker


.. code-block:: default


    nodes_3d_actor = actor.markers(
        centers+np.ones_like(centers)*25,
        marker='3d',
        colors=colors,
        scales=.5,
    )

    scene = window.Scene()

    scene.add(nodes_actor)
    scene.add(nodes_3d_actor)

    interactive = False 

    if interactive:
        window.show(scene, size=(600, 600))

    window.record(scene, out_path='viz_markers.png', size=(600, 600))



.. image:: /auto_examples/images/sphx_glr_viz_markers_001.png
    :class: sphx-glr-single-img





.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  2.088 seconds)


.. _sphx_glr_download_auto_examples_viz_markers.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download

     :download:`Download Python source code: viz_markers.py <viz_markers.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: viz_markers.ipynb <viz_markers.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_