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 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
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
```