Skip to content

Commit

Permalink
Merge pull request #1946 from iterative/plotscmd
Browse files Browse the repository at this point in the history
cmd: example on modifying an outputs into a plots
  • Loading branch information
jorgeorpinel authored Nov 22, 2020
2 parents d91881a + c53bd2e commit 3ae78e2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions content/docs/command-reference/plots/modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ 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
`dvc metrics` file into a plots file (see an
[example](#example-convert-any-output-into-a-plot)).

## Options

- `-t <name_or_path>, --template <name_or_path>` - set a default
Expand Down Expand Up @@ -131,3 +135,25 @@ be changed in many cases. A simple command changes the template:
```dvc
$ 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 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
```

```git
evaluate:
cmd: python src/evaluate.py
deps:
- src/evaluate.py
- outs:
- - logs.csv
plots:
- scores.json
+ - logs.csv
```

0 comments on commit 3ae78e2

Please sign in to comment.