Note
Go to the end to download the full example code
Fury Markers#
This example shows how to use the marker actor.
import numpy as np
import fury
n = 10000
There are nine types 2d markers: circle, square, diamond, triangle, pentagon, hexagon, heptagon, cross and plus.
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
In addition, an 3D sphere it’s also a valid type of marker
nodes_3d_actor = fury.actor.markers(
centers + np.ones_like(centers) * 25,
marker="3d",
colors=colors,
scales=0.5,
)
scene = fury.window.Scene()
scene.add(nodes_actor)
scene.add(nodes_3d_actor)
interactive = False
if interactive:
fury.window.show(scene, size=(600, 600))
fury.window.record(scene, out_path="viz_markers.png", size=(600, 600))
/opt/homebrew/Caskroom/miniforge/base/envs/py39/lib/python3.9/site-packages/sphinx_gallery/gen_rst.py:722: UserWarning: We'll no longer accept the way you call the record function in future versions of FURY.
Here's how to call the Function record: record(scene='value', cam_pos='value', cam_focal='value', cam_view='value', out_path='value', path_numbering='value', n_frames='value', az_ang='value', magnification='value', size='value', reset_camera='value', screen_clip='value', stereo='value', verbose='value')
exec(self.code, self.fake_main.__dict__)
Total running time of the script: (0 minutes 0.129 seconds)