From 92330af139cfa5db756823a07b6c0b3c614190d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Redzy=C5=84ski?= Date: Mon, 20 Jul 2020 17:47:22 +0200 Subject: [PATCH] plots: smooth: example --- content/docs/command-reference/plots/diff.md | 2 +- content/docs/command-reference/plots/index.md | 30 +++++++++++++++++++ static/img/plots_show_no_smooth.svg | 1 + static/img/plots_show_smooth.svg | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 static/img/plots_show_no_smooth.svg create mode 100644 static/img/plots_show_smooth.svg diff --git a/content/docs/command-reference/plots/diff.md b/content/docs/command-reference/plots/diff.md index f6792d6497..5ebef31601 100644 --- a/content/docs/command-reference/plots/diff.md +++ b/content/docs/command-reference/plots/diff.md @@ -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) diff --git a/content/docs/command-reference/plots/index.md b/content/docs/command-reference/plots/index.md index e60dab081a..a3665421cd 100644 --- a/content/docs/command-reference/plots/index.md +++ b/content/docs/command-reference/plots/index.md @@ -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 @@ -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: diff --git a/static/img/plots_show_no_smooth.svg b/static/img/plots_show_no_smooth.svg new file mode 100644 index 0000000000..bae27f1407 --- /dev/null +++ b/static/img/plots_show_no_smooth.svg @@ -0,0 +1 @@ +02004006008001,000index0.00.51.01.5yworkspacerev \ No newline at end of file diff --git a/static/img/plots_show_smooth.svg b/static/img/plots_show_smooth.svg new file mode 100644 index 0000000000..934fc97de0 --- /dev/null +++ b/static/img/plots_show_smooth.svg @@ -0,0 +1 @@ +02004006008001,000index0.20.40.60.81.01.2yworkspacerev \ No newline at end of file