Skip to content

Commit

Permalink
plots: smooth: example
Browse files Browse the repository at this point in the history
  • Loading branch information
pared committed Jul 22, 2020
1 parent cf74404 commit 92330af
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/command-reference/plots/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ To compare uncommitted changes of a metrics file and its last committed version:

```dvc
$ dvc plots diff --targets logs.csv --x-label x
file:///Users/dmitry/src/plots/logs.html
file:///Users/usr/src/plots/logs.html
```

![](/img/plots_auc.svg)
Expand Down
30 changes: 30 additions & 0 deletions content/docs/command-reference/plots/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ option of `dvc plots show` and `dvc plots diff`. For templates in the
`.dvc/plots/` directory, the path and the json extension are not required: you
can specify only the base name e.g. `--template scatter`.

DVC has the following built-in plot templates:

- `default` - linear plot
- `scatter` - scatter plot
- `smooth` - linear plot with LOESS smoothing, see
[example](/doc/command-reference/plots#example-smooth-plot)
- `confusion` - confusion matrix, see
[example](/doc/command-reference/plots#example-confusion-matrix)

### Custom templates

Plot template files are
Expand Down Expand Up @@ -198,6 +207,27 @@ file:///Users/usr/src/plots/logs.html

![](/img/plots_show_field.svg)

## Example: Smooth plot

In some cases we would like to smooth our plot. In this example we will use a
plot with 1000 data points:

```dvc
$ dvc plots show data.csv
file:///Users/usr/src/plots/plots.html
```

![](/img/plots_show_no_smooth.svg)

We can use the `-t` option and `smooth` template to make it less noisy:

```dvc
$ dvc plots show -t smooth data.csv
file:///Users/usr/src/plots/plots.html
```

![](/img/plots_show_smooth.svg)

## Example: Confusion matrix

We'll use `classes.csv` for this example:
Expand Down
1 change: 1 addition & 0 deletions static/img/plots_show_no_smooth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/img/plots_show_smooth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92330af

Please sign in to comment.