<jupyter_start><jupyter_text>MeshMesh is an object which displays triangles in 3d.An scalar can be displayed on the mesh using color map.<jupyter_code>from matplotlib.tri import Triangulation
import numpy as np
import k3d

# this code is a part of matplotlib trisurf3d_demo
n_radii = 8
n_angles = 36

radii = np.linspace(0.125, 1.0, n_radii, dtype=np.float32)
angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False, dtype=np.float32)[..., np.newaxis]

x = np.append(np.float32(0), (radii*np.cos(angles)).flatten())
y = np.append(np.float32(0), (radii*np.sin(angles)).flatten())

z = np.sin(-x*y)
indices = Triangulation(x,y).triangles.astype(np.uint32)

plot = k3d.plot()
plot
plt_mesh = k3d.mesh(np.vstack([x,y,z]).T, indices,
                   color_map = k3d.colormaps.basic_color_maps.Jet, 
                   attribute=z,
                   color_range = [-1.1,2.01]
                   )
plot += plt_mesh<jupyter_output><empty_output><jupyter_text>Scalars can be updated interactively using ipywidgets communication:<jupyter_code>plt_mesh.attribute = 2*x**2+y**2<jupyter_output><empty_output><jupyter_text>It is possible to send time series of an attribute values:<jupyter_code>plt_mesh.attribute = {str(t):3*t*x**2+y**2 for t in np.linspace(0,2,20)}
plot.start_auto_play()
plot.stop_auto_play()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13568215892053972, 'fraction_numerical': 0.03298350824587706, 'mean_word_length': 4.539419087136929, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '24967', 'license': 'MIT', 'n_tokens_mistral': 533, 'n_tokens_neox': 509, 'n_words': 100, 'path': 'docs/source/basic_functionality/Mesh.ipynb', 'repo_name': 'aot-devs/K3D-jupyter', 'size': '1334'}