Output Anchors

Output Anchors

Output anchors are used to add artifacts generated by your code during runtime to your Archive. We provide a broad range of output types to visualize your code artifacts of all forms, including but not limited to tables, text, images, graphs, and 3D models. These can be used to showcase input datasets, intermediate values, and final results.

You can create outputs in single-line using the following syntax:

# @output output_type data=output_variable

For example, here we create a table output which displays the numpy array x as a table

x = np.array([1,2,3])
# @output table data=x

Output Types

Below, you can find a preview of all of the different types of outputs that you can generate with the output anchor.

Output Types- Detailed

Below, you can find detailed documentation on all of the different types of outputs available to visualize variables in your code.

Text Output

This displays your variable as in string form as text.

Example Usage:

text = 'Text Output'
# @output heading data=text

Table Output

This displays your variable as a table. This supports dictionaries, lists, and 1D/2D numpy arrays.

Example Usage:

x = np.array([[1,2,3],[4,5,6]])
# @output table data=x

Matplotlib Figure Output

This plots and displays your Matplotlib figure as a static image.

Example Usage:

fig = plt.figure()
x = np.array([1,2,3,4,5,6])
y = np.array([1,2,3,4,5,6])
plt.scatter(x, y)
# @output graph data=fig

3D Model Output

This renders your 3D GLB file in an interactive 3D environment.

Example Usage:

# @output model data="./rover.glb"