clearml-docs/docs/guides/reporting/3d_plots_reporting.md

53 lines
1.4 KiB
Markdown
Raw Normal View History

2021-05-13 23:48:51 +00:00
---
title: 3D Plots Reporting
---
The [3d_plots_reporting.py](https://github.com/allegroai/clearml/blob/master/examples/reporting/3d_plots_reporting.py)
example demonstrates reporting a series as a surface plot and as a 3D scatter plot.
2023-09-04 12:40:42 +00:00
When the script runs, it creates an experiment named `3D plot reporting` in the `examples` project.
2021-05-13 23:48:51 +00:00
2022-05-26 06:54:41 +00:00
ClearML reports these plots in the experiment's **PLOTS** tab.
2021-05-13 23:48:51 +00:00
2021-09-09 10:17:46 +00:00
## Surface Plot
2021-05-13 23:48:51 +00:00
2024-03-06 13:00:50 +00:00
To plot a series as a surface plot, use [`Logger.report_surface()`](../../references/sdk/logger.md#report_surface):
2021-05-13 23:48:51 +00:00
2021-12-14 13:12:30 +00:00
```python
# report 3d surface
surface = np.random.randint(10, size=(10, 10))
Logger.current_logger().report_surface(
2024-03-06 13:00:50 +00:00
title="example_surface",
series="series1",
2021-12-14 13:12:30 +00:00
iteration=iteration,
matrix=surface,
xaxis="title X",
yaxis="title Y",
zaxis="title Z",
)
```
2023-11-05 08:30:37 +00:00
View the reported surface plot in **PLOTS**.
2021-05-13 23:48:51 +00:00
2021-12-14 13:12:30 +00:00
![Surface plot](../../img/examples_reporting_02.png)
2021-05-13 23:48:51 +00:00
2021-09-09 10:17:46 +00:00
## 3D Scatter Plot
2021-05-13 23:48:51 +00:00
2024-03-06 13:00:50 +00:00
To plot a series as a 3D scatter plot, use [`Logger.report_scatter3d()`](../../references/sdk/logger.md#report_scatter3d):
2021-12-14 13:12:30 +00:00
```python
# report 3d scatter plot
scatter3d = np.random.randint(10, size=(10, 3))
Logger.current_logger().report_scatter3d(
2024-03-06 13:00:50 +00:00
title="example_scatter_3d",
series="series_xyz",
2021-12-14 13:12:30 +00:00
iteration=iteration,
scatter=scatter3d,
xaxis="title x",
yaxis="title y",
zaxis="title z",
)
```
2021-05-13 23:48:51 +00:00
2023-11-05 08:30:37 +00:00
View the reported 3D scatter plot in **PLOTS**.
2021-12-14 13:12:30 +00:00
![3d scatter plot](../../img/examples_reporting_01.png)