Skip to content

Logging custom x values for graph#

When logging metrics or other series of values to be plotted as a chart, you can specify custom values to use for the x axis with the step argument.

run["metric"].append(
    value=acc,
    step=i,
)

Note

The entries logged for step must be strictly increasing Int or Float values.

Logging images with custom index#

You might use the epoch number as the index for the append() method when logging a series of Matplotlib figures.

import neptune
import matplotlib.pyplot as plt

run = neptune.init_run()

for epoch in range(100):
    plt_fig = get_histogram()

    run["train/distribution"].append(
        plt_fig,
        step=epoch,
    )

Logging custom charts#

If you have customized charts with special values for the x axis, rather than logging the individual values as a series, you can create your own plot objects and upload those to Neptune.

Single static plot
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(7, 9))
run["matplotlib-fig"].upload(fig)
Single interactive plot
from neptune.types import File

fig = ...
run["visuals/matplotlib-fig"].upload(File.as_html(fig))