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

Plots: mention the VS Code Extension for visualization #3784

Merged
merged 9 commits into from
Jul 23, 2022
9 changes: 7 additions & 2 deletions content/docs/command-reference/plots/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,18 @@ DVC can work with two types of plots files:
1. Data series files, which can be JSON, YAML, CSV or TSV.
2. Image files in JPEG, GIF, or PNG format.

DVC generates plots as static HTML webpages that can be open with a web browser.
They can also be saved as SVG or PNG image files from the browser.
DVC generates plots as static HTML webpages you can open with a web browser
(they can be saved as SVG or PNG image files from there). You can also visualize
DVC plots from the VS Code Extension, which includes a special [Plots Dashboard]
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
that corresponds to the features in the `dvc plots` commands.

Data-series plots utilize [Vega-Lite](https://vega.github.io/vega-lite/) for
rendering (declarative JSON grammar for defining graphics). Image-type plots are
rendered using `<img>` tags directly.

[plots dashboard]:
https://github.com/iterative/vscode-dvc/blob/main/extension/resources/walkthrough/plots.md

## Supported file formats

Image-type plots are included in HTML as-is, without additional processing.
Expand Down
10 changes: 9 additions & 1 deletion content/docs/start/data-management/metrics-parameters-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ Modifying stage 'evaluate' in 'dvc.yaml'

```

Now let's view the plots:
Now let's view the plots. You can run `dvc plots show` on your Terminal (shown
below), which generates an HTML file you can open in a browser. Or you can load
your project in VS Code and use the [Plots Dashboard] of the [DVC Extension] to
visualize them.

```dvc
$ dvc plots show
Expand All @@ -156,6 +159,11 @@ Later we will see how to
For now, let's see how can we capture another important piece of information
which will be useful for comparison: parameters.

[plots dashboard]:
https://github.com/iterative/vscode-dvc/blob/main/extension/resources/walkthrough/plots.md
[dvc extension]:
https://marketplace.visualstudio.com/items?itemName=Iterative.dvc

## Defining stage parameters

It's pretty common for data science pipelines to include configuration files
Expand Down
19 changes: 13 additions & 6 deletions content/docs/start/experiments/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ actual,predicted
> We added a [loop] comparing the results to generate this file from the
> predictions.

[loop]:
https://github.com/iterative/example-dvc-experiments/blob/main/src/train.py#L123
[confusion matrix]: https://en.wikipedia.org/wiki/Confusion_matrix

Running the experiment with `dvc exp run` will produce `plots/confusion.csv`.
Use `dvc plots show` to present it as an HTML file, and open it in the browser:
You can run `dvc plots show` on your Terminal to generate and embed them in an
HTML file you can open in the browser (shown below). Or you can load your
project in VS Code and use the [Plots Dashboard] of the [DVC Extension] to
visualize them.

```dvc
$ dvc plots show plots/confusion.csv --template confusion \
Expand All @@ -42,6 +41,14 @@ file:///.../example-dvc-experiments/plots/confusion.json.html

![confusion matrix](/img/start_visualization_confusion1.png)

[confusion matrix]: https://en.wikipedia.org/wiki/Confusion_matrix
[loop]:
https://github.com/iterative/example-dvc-experiments/blob/main/src/train.py#L123
[plots dashboard]:
https://github.com/iterative/vscode-dvc/blob/main/extension/resources/walkthrough/plots.md
[dvc extension]:
https://marketplace.visualstudio.com/items?itemName=Iterative.dvc

## Displaying user-generated plot images

Let's produce another plot to see misclassified examples from each class. This
Expand All @@ -55,7 +62,7 @@ project.][misclassified-example-code]
https://github.com/iterative/example-dvc-experiments/blob/48b1e5078c957f71674c00f416290eaa3b20b559/src/util.py#L49

```dvc
$ dvc plots show plots/misclassified.png
$ dvc plots show --open plots/misclassified.png
```

![Misclassification table](/img/start_visualization_misclassification.png)
Expand Down