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

cmd: example on modifying any outputs into a plots #1946

Merged
merged 6 commits into from
Nov 22, 2020
Merged
Changes from 3 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
28 changes: 28 additions & 0 deletions content/docs/command-reference/plots/modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
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/).
Expand Down Expand Up @@ -131,3 +135,27 @@ 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

We can use `dvc plots modify` to make an <abbr>output</abbr> 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
```

Changes in `dvc.yaml` shows `logs.csv` is now a plot:

```git
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
evaluate:
cmd: python src/evaluate.py
deps:
- src/evaluate.py
- outs:
- - logs.csv
plots:
- scores.json
+ - logs.csv
```