Skip to main content
Using the methods in wandb.plot, you can track charts with wandb.Run.log(), including charts that change over time during training. To learn more about our custom charting framework, check out the custom charts walkthrough.

Basic charts

These simple charts make it easy to construct basic visualizations of metrics and results.
Log a custom line plot—a list of connected and ordered points on arbitrary axes.
You can use this to log curves on any two dimensions. If you’re plotting two lists of values against each other, the number of values in the lists must match exactly. For example, each point must have an x and a y.
Custom line plot
See in the appRun the code

Model evaluation charts

These preset charts have built-in wandb.plot() methods that make it quick and easy to log charts directly from your script and see the exact information you’re looking for in the UI.
Create a Precision-Recall curve in one line:
You can log this whenever your code has access to:
  • a model’s predicted scores (predictions) on a set of examples
  • the corresponding ground truth labels (ground_truth) for those examples
  • (optionally) a list of the labels/class names (labels=["cat", "dog", "bird"...] if label index 0 means cat, 1 = dog, 2 = bird, etc.)
  • (optionally) a subset (still in list format) of the labels to visualize in the plot
Precision-recall curve
See in the appRun the code

Interactive custom charts

For full customization, tweak a built-in Custom Chart preset or create a new preset, then save the chart. Use the chart ID to log data to that custom preset directly from your script.
Run the code

Matplotlib and Plotly plots

Instead of using W&B Custom Charts with wandb.plot(), you can log charts generated with matplotlib and Plotly.
Just pass a matplotlib plot or figure object to wandb.Run.log(). By default we’ll convert the plot into a Plotly plot. If you’d rather log the plot as an image, you can pass the plot into wandb.Image. We also accept Plotly charts directly.
If you’re getting an error “You attempted to log an empty plot” then you can store the figure separately from the plot with fig = plt.figure() and then log fig in your call to wandb.Run.log().

Log custom HTML to W&B Tables

W&B supports logging interactive charts from Plotly and Bokeh as HTML and adding them to Tables.

Log Plotly figures to Tables as HTML

You can log interactive Plotly charts to wandb Tables by converting them to HTML.

Log Bokeh figures to Tables as HTML

You can log interactive Bokeh charts to wandb Tables by converting them to HTML.