Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle plots: smooth: example #1609

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 `-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.