Skip to main content

Description

DVC plots commands generate interactive visualizations from your data files. These commands create HTML reports with charts and graphs to help you analyze model performance, training dynamics, and experiment results.

Subcommands

plots show

Generate plots from target files or from plots definitions in dvc.yaml.
dvc plots show

Arguments

targets
list
Plots files or plot IDs from dvc.yaml to visualize. Shows all plots by default.

Options

-t, --template
string
Special JSON or HTML schema file to inject with the data. See plot templates.
-x
string
Field name for X axis.
-y
string
Field name for Y axis.
--no-header
flag
Provided CSV or TSV datafile does not have a header.
--title
string
Plot title.
--x-label
string
X axis label.
--y-label
string
Y axis label.
-o, --out
string
Directory to save plots to. Defaults to dvc_plots.
--show-vega
flag
Show output in Vega format.
--open
flag
Open plot file directly in the browser.
--html-template
string
Custom HTML template for VEGA visualization.

plots diff

Show multiple versions of a plot by overlaying them in a single image.
dvc plots diff HEAD~1 HEAD

Arguments

revisions
list
Git commits to plot from. Compares workspace with HEAD by default.

Options

--targets
list
Specific plots to visualize. Accepts any file path or plot name from dvc.yaml file. Shows all tracked plots by default.
-t, --template
string
Special JSON or HTML schema file to inject with the data.
-x
string
Field name for X axis.
-y
string
Field name for Y axis.
--no-header
flag
Provided CSV or TSV datafile does not have a header.
--title
string
Plot title.
--x-label
string
X axis label.
--y-label
string
Y axis label.
-o, --out
string
Directory to save plots to.
--open
flag
Open plot file directly in the browser.
--html-template
string
Custom HTML template for VEGA visualization.

plots modify

Modify display properties of data-series plots defined in stages (has no effect on image plots).
dvc plots modify training.csv -x epoch -y accuracy

Arguments

target
string
required
Plots file to set properties for (defined at the stage level).

Options

-t, --template
string
Plot template to use.
-x
string
Field name for X axis.
-y
string
Field name for Y axis.
--title
string
Plot title.
--x-label
string
X axis label.
--y-label
string
Y axis label.
--unset
list
Unset one or more display properties.

plots templates

List built-in plots templates or show JSON specification for one.
dvc plots templates

Arguments

template
string
Template for which to show JSON specification. List all template names by default.

Examples

Visualizing Training Metrics

# Generate plots for training history
dvc plots show training_history.csv -x epoch -y loss --title "Training Loss"
This creates an HTML file with an interactive line chart showing loss over epochs.

Comparing Model Versions

# Compare plots across different model versions
dvc plots diff v1.0 v2.0 v3.0 --targets metrics/accuracy.csv
Creates overlaid plots showing how accuracy evolved across three model versions.

Custom Plot Configuration

# Create scatter plot with custom labels
dvc plots show results.csv \
  -x learning_rate \
  -y accuracy \
  --title "Hyperparameter Tuning Results" \
  --x-label "Learning Rate" \
  --y-label "Model Accuracy"

Auto-Open in Browser

# Generate and immediately view plots
dvc plots show --open
Enable auto-open permanently with: dvc config plots.auto_open true

Supported Data Formats

training.csv
epoch,loss,accuracy
1,0.8234,0.6543
2,0.5123,0.7654
3,0.3456,0.8123
metrics.json
[
  {"epoch": 1, "loss": 0.8234, "accuracy": 0.6543},
  {"epoch": 2, "loss": 0.5123, "accuracy": 0.7654},
  {"epoch": 3, "loss": 0.3456, "accuracy": 0.8123}
]
data.tsv
step	precision	recall
100	0.85	0.82
200	0.89	0.87
300	0.92	0.91
DVC plots also supports image files (PNG, JPEG, SVG) for displaying confusion matrices, visualizations, and other graphics.

Built-in Templates

Linear

Line plot for time series data

Scatter

Scatter plot for correlation analysis

Smooth

Smoothed line plot

Confusion

Confusion matrix heatmap

Bar

Bar chart for categorical data

Custom

Bring your own Vega-Lite spec

Output Structure

When you run dvc plots show, DVC creates:
dvc_plots/
├── index.html          # Main visualization page
└── static/
    ├── data/           # Plot data files
    └── vega/           # Vega specifications
The output directory can be customized with -o, --out option or by setting plots.out_dir in DVC config.
Plot files must be tracked by DVC (in dvc.yaml or .dvc files) to be included in dvc plots diff.

Use Cases

Training Monitoring

Visualize loss curves, accuracy trends, and other training metrics over time.

Model Comparison

Compare performance metrics across different model architectures or hyperparameters.

A/B Testing

Visualize differences between control and experimental model versions.

Performance Analysis

Create confusion matrices, ROC curves, and precision-recall plots.
  • dvc metrics - Display metrics in tabular format
  • dvc params - Track parameter changes
  • dvc exp show - Show experiments with metrics and params

Build docs developers (and LLMs) love