From 71e19ea6987cfb7a8a638cf26ad6d14890137929 Mon Sep 17 00:00:00 2001 From: Hardik Jaroli Date: Fri, 13 Nov 2020 17:11:16 +0530 Subject: [PATCH 1/6] Replacing column number with index --- content/docs/command-reference/plots/diff.md | 9 +++++---- content/docs/command-reference/plots/modify.md | 4 ++-- content/docs/command-reference/plots/show.md | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/content/docs/command-reference/plots/diff.md b/content/docs/command-reference/plots/diff.md index 5bcd21353d..7fcae4948b 100644 --- a/content/docs/command-reference/plots/diff.md +++ b/content/docs/command-reference/plots/diff.md @@ -77,12 +77,13 @@ all the current plots, without comparisons. - `-x ` - field name from which the X axis data comes from. An auto-generated `index` field is used by default. See [Custom templates](/doc/command-reference/plots#custom-templates) for more - information on this `index` field. Column names or numbers are expected for - tabular metrics files. + information on this `index` field. Column names or indices (when `--no-header` + option is specified) are expected for tabular metrics files. - `-y ` - field name from which the Y axis data comes from. The last - field found in the `--targets` is used by default. Column names or numbers are - expected for tabular metrics files. + field found in the `--targets` is used by default. Column names or indices + (when `--no-header` option is specified) are expected for tabular metrics + files. - `--x-label ` - X axis label. The X field name is the default. diff --git a/content/docs/command-reference/plots/modify.md b/content/docs/command-reference/plots/modify.md index 84a62d7b90..7b73810780 100644 --- a/content/docs/command-reference/plots/modify.md +++ b/content/docs/command-reference/plots/modify.md @@ -35,10 +35,10 @@ Property names are passed as [options](#options) to this command (prefixed with - `-t , --template ` - set a default [plot template](/doc/command-reference/plots#plot-templates). -- `-x ` - set a default field or column name (or number) from which the X +- `-x ` - set a default field or column name (or index) from which the X axis data comes from. -- `-y ` - set a default field or column name (or number) from which the Y +- `-y ` - set a default field or column name (or index) from which the Y axis data comes from. - `--x-label ` - set a default title for the X axis. diff --git a/content/docs/command-reference/plots/show.md b/content/docs/command-reference/plots/show.md index 441380cb5e..1e69929180 100644 --- a/content/docs/command-reference/plots/show.md +++ b/content/docs/command-reference/plots/show.md @@ -48,12 +48,12 @@ please see `dvc plots`. - `-x ` - field name from which the X axis data comes from. An auto-generated `index` field is used by default. See [Custom templates](/doc/command-reference/plots#custom-templates) for more - information on this `index` field. Column names or numbers are expected for - tabular metrics files. + information on this `index` field. Column names or indices (when `--no-header` + option is specified) are expected for tabular metrics files. - `-y ` - field name from which the Y axis data comes from. The last - field found in the `targets` is used by default. Column names or numbers are - expected for tabular metrics files. + field found in the `targets` is used by default. Column names or indices (when + `--no-header` option is specified) are expected for tabular metrics files. - `--x-label ` - X axis label. The X field name is the default. From 6caa73c83eed9d3cc7d0e91493aca6f6e854da68 Mon Sep 17 00:00:00 2001 From: Hardik Jaroli Date: Fri, 13 Nov 2020 18:27:22 +0530 Subject: [PATCH 2/6] plots modify: make regular output into plot example --- .../docs/command-reference/plots/modify.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/content/docs/command-reference/plots/modify.md b/content/docs/command-reference/plots/modify.md index 7b73810780..e4a90c0170 100644 --- a/content/docs/command-reference/plots/modify.md +++ b/content/docs/command-reference/plots/modify.md @@ -123,6 +123,29 @@ plots: title: Accuracy ``` +## Example: Make a regular output into a plot + +We can use `dvc plots modify` to make an output or metrics file of +a stage into a plot. Lets take an example stage `evaluate` which has an +output `logs.csv`: + +```yaml +evaluate: + cmd: python src/evaluate.py + deps: + - src/evaluate.py + outs: + - logs.csv + plots: + - scores.json +``` + +To change the output file `logs.csv` into a plot run: + +```dvc +$ dvc plots modify logs.csv +``` + ## Example: Template change _dvc run --plots file.csv ..._ command assign the default template that needs to From a66b9b789671f926389983b8bdfc9ca2aca640c6 Mon Sep 17 00:00:00 2001 From: Hardik Jaroli Date: Fri, 20 Nov 2020 01:53:22 +0530 Subject: [PATCH 3/6] Modify example update --- content/docs/command-reference/plots/diff.md | 9 ++-- .../docs/command-reference/plots/modify.md | 49 ++++++++++--------- content/docs/command-reference/plots/show.md | 8 +-- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/content/docs/command-reference/plots/diff.md b/content/docs/command-reference/plots/diff.md index 7fcae4948b..5bcd21353d 100644 --- a/content/docs/command-reference/plots/diff.md +++ b/content/docs/command-reference/plots/diff.md @@ -77,13 +77,12 @@ all the current plots, without comparisons. - `-x ` - field name from which the X axis data comes from. An auto-generated `index` field is used by default. See [Custom templates](/doc/command-reference/plots#custom-templates) for more - information on this `index` field. Column names or indices (when `--no-header` - option is specified) are expected for tabular metrics files. + information on this `index` field. Column names or numbers are expected for + tabular metrics files. - `-y ` - field name from which the Y axis data comes from. The last - field found in the `--targets` is used by default. Column names or indices - (when `--no-header` option is specified) are expected for tabular metrics - files. + field found in the `--targets` is used by default. Column names or numbers are + expected for tabular metrics files. - `--x-label ` - X axis label. The X field name is the default. diff --git a/content/docs/command-reference/plots/modify.md b/content/docs/command-reference/plots/modify.md index e4a90c0170..c2c5b6eb4f 100644 --- a/content/docs/command-reference/plots/modify.md +++ b/content/docs/command-reference/plots/modify.md @@ -26,6 +26,10 @@ The path to the metrics file `target` is required. It must be listed in a `dvc.yaml` file (see the `--plots` option of `dvc run`). `dvc plots modify` adds the display properties to `dvc.yaml`. +Convert any +[output or simple metrics file into a plot](#example-convert-any-output-into-a-plot) +by passing it as a `target` to `dvc plot modify`. + Property names are passed as [options](#options) to this command (prefixed with `--`). These are based on the full [Vega specification](https://vega.github.io/vega/docs/specification/). @@ -35,10 +39,10 @@ Property names are passed as [options](#options) to this command (prefixed with - `-t , --template ` - set a default [plot template](/doc/command-reference/plots#plot-templates). -- `-x ` - set a default field or column name (or index) from which the X +- `-x ` - set a default field or column name (or number) from which the X axis data comes from. -- `-y ` - set a default field or column name (or index) from which the Y +- `-y ` - set a default field or column name (or number) from which the Y axis data comes from. - `--x-label ` - set a default title for the X axis. @@ -123,34 +127,35 @@ plots: title: Accuracy ``` -## Example: Make a regular output into a plot +## Example: Template change -We can use `dvc plots modify` to make an output or metrics file of -a stage into a plot. Lets take an example stage `evaluate` which has an -output `logs.csv`: +_dvc run --plots file.csv ..._ command assign the default template that needs to +be changed in many cases. A simple command changes the template: -```yaml -evaluate: - cmd: python src/evaluate.py - deps: - - src/evaluate.py - outs: - - logs.csv - plots: - - scores.json +```dvc +$ dvc plots modify classes.csv --template confusion ``` -To change the output file `logs.csv` into a plot run: +## Example: Convert any output into a plot + +We can use `dvc plots modify` to make an output or simple metrics +file of a stage into a plot. Lets take an example `evaluate` stage which has +`logs.csv` as output. To change the output file `logs.csv` into a plot run: ```dvc $ dvc plots modify logs.csv ``` -## Example: Template change +Changes in `dvc.yaml` shows `logs.csv` is now a plot: -_dvc run --plots file.csv ..._ command assign the default template that needs to -be changed in many cases. A simple command changes the template: - -```dvc -$ dvc plots modify classes.csv --template confusion +```git +evaluate: + cmd: python src/evaluate.py + deps: + - src/evaluate.py +- outs: +- - logs.csv + plots: + - scores.json ++ - logs.csv ``` diff --git a/content/docs/command-reference/plots/show.md b/content/docs/command-reference/plots/show.md index 1e69929180..441380cb5e 100644 --- a/content/docs/command-reference/plots/show.md +++ b/content/docs/command-reference/plots/show.md @@ -48,12 +48,12 @@ please see `dvc plots`. - `-x ` - field name from which the X axis data comes from. An auto-generated `index` field is used by default. See [Custom templates](/doc/command-reference/plots#custom-templates) for more - information on this `index` field. Column names or indices (when `--no-header` - option is specified) are expected for tabular metrics files. + information on this `index` field. Column names or numbers are expected for + tabular metrics files. - `-y ` - field name from which the Y axis data comes from. The last - field found in the `targets` is used by default. Column names or indices (when - `--no-header` option is specified) are expected for tabular metrics files. + field found in the `targets` is used by default. Column names or numbers are + expected for tabular metrics files. - `--x-label ` - X axis label. The X field name is the default. From 230514964ea875dc2543061812bb158486fe7259 Mon Sep 17 00:00:00 2001 From: Hardik Jaroli Date: Sat, 21 Nov 2020 23:56:29 +0530 Subject: [PATCH 4/6] Updating description paragraph --- content/docs/command-reference/plots/modify.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/content/docs/command-reference/plots/modify.md b/content/docs/command-reference/plots/modify.md index c2c5b6eb4f..cdbc29457e 100644 --- a/content/docs/command-reference/plots/modify.md +++ b/content/docs/command-reference/plots/modify.md @@ -26,14 +26,14 @@ The path to the metrics file `target` is required. It must be listed in a `dvc.yaml` file (see the `--plots` option of `dvc run`). `dvc plots modify` adds the display properties to `dvc.yaml`. -Convert any -[output or simple metrics file into a plot](#example-convert-any-output-into-a-plot) -by passing it as a `target` to `dvc plot modify`. - Property names are passed as [options](#options) to this command (prefixed with `--`). These are based on the full [Vega specification](https://vega.github.io/vega/docs/specification/). +Note that a secondary use of this command is to convert output or simple +[metrics file](/doc/command-reference/metrics) into a plot (see +[example](#example-convert-any-output-into-a-plot)). + ## Options - `-t , --template ` - set a default @@ -138,16 +138,14 @@ $ dvc plots modify classes.csv --template confusion ## Example: Convert any output into a plot -We can use `dvc plots modify` to make an output or simple metrics -file of a stage into a plot. Lets take an example `evaluate` stage which has -`logs.csv` as output. To change the output file `logs.csv` into a plot run: +Let's take an example `evaluate` stage which has `logs.csv` as an output. We use +`dvc plots modify` to convert the `logs.csv` output file into a plot, and then +observe changes that happened in `dvc.yaml`: ```dvc $ dvc plots modify logs.csv ``` -Changes in `dvc.yaml` shows `logs.csv` is now a plot: - ```git evaluate: cmd: python src/evaluate.py From b43edc32988ad5c05dc293ea1e59bb4ef5df6f0f Mon Sep 17 00:00:00 2001 From: Hardik Jaroli Date: Mon, 23 Nov 2020 02:06:51 +0530 Subject: [PATCH 5/6] Updates to descriptiom --- content/docs/command-reference/plots/modify.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/command-reference/plots/modify.md b/content/docs/command-reference/plots/modify.md index cdbc29457e..e45d2d4099 100644 --- a/content/docs/command-reference/plots/modify.md +++ b/content/docs/command-reference/plots/modify.md @@ -31,7 +31,7 @@ Property names are passed as [options](#options) to this command (prefixed with [Vega specification](https://vega.github.io/vega/docs/specification/). Note that a secondary use of this command is to convert output or simple -[metrics file](/doc/command-reference/metrics) into a plot (see +`dvc metrics` file into a plots file (see [example](#example-convert-any-output-into-a-plot)). ## Options @@ -138,9 +138,9 @@ $ dvc plots modify classes.csv --template confusion ## Example: Convert any output into a plot -Let's take an example `evaluate` stage which has `logs.csv` as an output. We use -`dvc plots modify` to convert the `logs.csv` output file into a plot, and then -observe changes that happened in `dvc.yaml`: +Let's take an example `evaluate` stage which has `logs.csv` as an output. We can +use `dvc plots modify` to convert the `logs.csv` output file into a plots file, +and then confirm the changes that happened in `dvc.yaml`: ```dvc $ dvc plots modify logs.csv From c53bd2e1a4ac9c519a3840beda159b1cfe220dcc Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Sun, 22 Nov 2020 17:38:08 -0600 Subject: [PATCH 6/6] Update content/docs/command-reference/plots/modify.md --- content/docs/command-reference/plots/modify.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/command-reference/plots/modify.md b/content/docs/command-reference/plots/modify.md index e45d2d4099..082fc22ea8 100644 --- a/content/docs/command-reference/plots/modify.md +++ b/content/docs/command-reference/plots/modify.md @@ -31,7 +31,7 @@ Property names are passed as [options](#options) to this command (prefixed with [Vega specification](https://vega.github.io/vega/docs/specification/). Note that a secondary use of this command is to convert output or simple -`dvc metrics` file into a plots file (see +`dvc metrics` file into a plots file (see an [example](#example-convert-any-output-into-a-plot)). ## Options