We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
plots --open: not working on macOS
We use relpath to open files in the browser.

https://github.com/iterative/dvc/blob/59cfc2c4a43e9b9d2fdb583da80d24e82ae39c26/dvc/command/plots.py#L60

This is mostly done to support `wsl`, and the fact that all other Platform seem to work, if it's relative or absolute.

The reason why it does not work is because `web browser.open` messes up. 🤦🏼 
https://github.com/python/cpython/blob/39dd141a4ba68bbb38fd00a65cdcff711acdafb5/Lib/webbrowser.py#L638-L639
plots --open: not working on macOS
We use relpath to open files in the browser.

https://github.com/iterative/dvc/blob/59cfc2c4a43e9b9d2fdb583da80d24e82ae39c26/dvc/command/plots.py#L60

This is mostly done to support `wsl`, and the fact that all other Platform seem to work, if it's relative or absolute.

The reason why it does not work is because `web browser.open` messes up. 🤦🏼 
https://github.com/python/cpython/blob/39dd141a4ba68bbb38fd00a65cdcff711acdafb5/Lib/webbrowser.py#L638-L639

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dvc/command/plots.py`
Content:
```
1 import argparse
2 import logging
3 
4 from dvc.command import completion
5 from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
6 from dvc.exceptions import DvcException
7 from dvc.render.utils import find_vega, render
8 from dvc.ui import ui
9 from dvc.utils import format_link
10 
11 logger = logging.getLogger(__name__)
12 
13 
14 class CmdPlots(CmdBase):
15     def _func(self, *args, **kwargs):
16         raise NotImplementedError
17 
18     def _props(self):
19         from dvc.schema import PLOT_PROPS
20 
21         # Pass only props specified by user, to not shadow ones from plot def
22         props = {p: getattr(self.args, p) for p in PLOT_PROPS}
23         return {k: v for k, v in props.items() if v is not None}
24 
25     def run(self):
26         from pathlib import Path
27 
28         if self.args.show_vega:
29             if not self.args.targets:
30                 logger.error("please specify a target for `--show-vega`")
31                 return 1
32             if len(self.args.targets) > 1:
33                 logger.error(
34                     "you can only specify one target for `--show-vega`"
35                 )
36                 return 1
37 
38         try:
39             plots_data = self._func(
40                 targets=self.args.targets, props=self._props()
41             )
42 
43             if not plots_data:
44                 ui.error_write(
45                     "No plots were loaded, "
46                     "visualization file will not be created."
47                 )
48 
49             if self.args.show_vega:
50                 target = self.args.targets[0]
51                 plot_json = find_vega(self.repo, plots_data, target)
52                 if plot_json:
53                     ui.write(plot_json)
54                 return 0
55 
56             rel: str = self.args.out or "dvc_plots"
57             path: Path = (Path.cwd() / rel).resolve()
58             index_path = render(
59                 self.repo,
60                 plots_data,
61                 path=path,
62                 html_template_path=self.args.html_template,
63             )
64 
65             assert index_path.is_absolute()
66             url = index_path.as_uri()
67             ui.write(url)
68 
69             if self.args.open:
70                 import webbrowser
71 
72                 opened = webbrowser.open(index_path)
73                 if not opened:
74                     ui.error_write(
75                         "Failed to open. Please try opening it manually."
76                     )
77                     return 1
78             return 0
79 
80         except DvcException:
81             logger.exception("")
82             return 1
83 
84 
85 class CmdPlotsShow(CmdPlots):
86     UNINITIALIZED = True
87 
88     def _func(self, *args, **kwargs):
89         return self.repo.plots.show(*args, **kwargs)
90 
91 
92 class CmdPlotsDiff(CmdPlots):
93     UNINITIALIZED = True
94 
95     def _func(self, *args, **kwargs):
96         return self.repo.plots.diff(
97             *args,
98             revs=self.args.revisions,
99             experiment=self.args.experiment,
100             **kwargs,
101         )
102 
103 
104 class CmdPlotsModify(CmdPlots):
105     def run(self):
106         self.repo.plots.modify(
107             self.args.target, props=self._props(), unset=self.args.unset
108         )
109         return 0
110 
111 
112 def add_parser(subparsers, parent_parser):
113     PLOTS_HELP = (
114         "Commands to visualize and compare plot metrics in structured files "
115         "(JSON, YAML, CSV, TSV)."
116     )
117 
118     plots_parser = subparsers.add_parser(
119         "plots",
120         parents=[parent_parser],
121         description=append_doc_link(PLOTS_HELP, "plots"),
122         help=PLOTS_HELP,
123         formatter_class=argparse.RawDescriptionHelpFormatter,
124     )
125     plots_subparsers = plots_parser.add_subparsers(
126         dest="cmd",
127         help="Use `dvc plots CMD --help` to display command-specific help.",
128     )
129 
130     fix_subparsers(plots_subparsers)
131 
132     SHOW_HELP = "Generate plots from metrics files."
133     plots_show_parser = plots_subparsers.add_parser(
134         "show",
135         parents=[parent_parser],
136         description=append_doc_link(SHOW_HELP, "plots/show"),
137         help=SHOW_HELP,
138         formatter_class=argparse.RawDescriptionHelpFormatter,
139     )
140     plots_show_parser.add_argument(
141         "targets",
142         nargs="*",
143         help="Files to visualize (supports any file, "
144         "even when not found as `plots` in `dvc.yaml`). "
145         "Shows all plots by default.",
146     ).complete = completion.FILE
147     _add_props_arguments(plots_show_parser)
148     _add_output_arguments(plots_show_parser)
149     plots_show_parser.set_defaults(func=CmdPlotsShow)
150 
151     PLOTS_DIFF_HELP = (
152         "Show multiple versions of plot metrics "
153         "by plotting them in a single image."
154     )
155     plots_diff_parser = plots_subparsers.add_parser(
156         "diff",
157         parents=[parent_parser],
158         description=append_doc_link(PLOTS_DIFF_HELP, "plots/diff"),
159         help=PLOTS_DIFF_HELP,
160         formatter_class=argparse.RawDescriptionHelpFormatter,
161     )
162     plots_diff_parser.add_argument(
163         "--targets",
164         nargs="*",
165         help=(
166             "Specific plots file(s) to visualize "
167             "(even if not found as `plots` in `dvc.yaml`). "
168             "Shows all tracked plots by default."
169         ),
170         metavar="<paths>",
171     ).complete = completion.FILE
172     plots_diff_parser.add_argument(
173         "-e",
174         "--experiment",
175         action="store_true",
176         default=False,
177         help=argparse.SUPPRESS,
178     )
179     plots_diff_parser.add_argument(
180         "revisions", nargs="*", default=None, help="Git commits to plot from"
181     )
182     _add_props_arguments(plots_diff_parser)
183     _add_output_arguments(plots_diff_parser)
184     plots_diff_parser.set_defaults(func=CmdPlotsDiff)
185 
186     PLOTS_MODIFY_HELP = (
187         "Modify display properties of data-series plots "
188         "(has no effect on image-type plots)."
189     )
190     plots_modify_parser = plots_subparsers.add_parser(
191         "modify",
192         parents=[parent_parser],
193         description=append_doc_link(PLOTS_MODIFY_HELP, "plots/modify"),
194         help=PLOTS_MODIFY_HELP,
195         formatter_class=argparse.RawDescriptionHelpFormatter,
196     )
197     plots_modify_parser.add_argument(
198         "target", help="Metric file to set properties to"
199     ).complete = completion.FILE
200     _add_props_arguments(plots_modify_parser)
201     plots_modify_parser.add_argument(
202         "--unset",
203         nargs="*",
204         metavar="<property>",
205         help="Unset one or more display properties.",
206     )
207     plots_modify_parser.set_defaults(func=CmdPlotsModify)
208 
209 
210 def _add_props_arguments(parser):
211     parser.add_argument(
212         "-t",
213         "--template",
214         nargs="?",
215         default=None,
216         help=(
217             "Special JSON or HTML schema file to inject with the data. "
218             "See {}".format(
219                 format_link("https://man.dvc.org/plots#plot-templates")
220             )
221         ),
222         metavar="<path>",
223     ).complete = completion.FILE
224     parser.add_argument(
225         "-x", default=None, help="Field name for X axis.", metavar="<field>"
226     )
227     parser.add_argument(
228         "-y", default=None, help="Field name for Y axis.", metavar="<field>"
229     )
230     parser.add_argument(
231         "--no-header",
232         action="store_false",
233         dest="header",
234         default=None,  # Use default None to distinguish when it's not used
235         help="Provided CSV or TSV datafile does not have a header.",
236     )
237     parser.add_argument(
238         "--title", default=None, metavar="<text>", help="Plot title."
239     )
240     parser.add_argument(
241         "--x-label", default=None, help="X axis label", metavar="<text>"
242     )
243     parser.add_argument(
244         "--y-label", default=None, help="Y axis label", metavar="<text>"
245     )
246 
247 
248 def _add_output_arguments(parser):
249     parser.add_argument(
250         "-o",
251         "--out",
252         default=None,
253         help="Destination path to save plots to",
254         metavar="<path>",
255     ).complete = completion.DIR
256     parser.add_argument(
257         "--show-vega",
258         action="store_true",
259         default=False,
260         help="Show output in Vega format.",
261     )
262     parser.add_argument(
263         "--open",
264         action="store_true",
265         default=False,
266         help="Open plot file directly in the browser.",
267     )
268     parser.add_argument(
269         "--html-template",
270         default=None,
271         help="Custom HTML template for VEGA visualization.",
272         metavar="<path>",
273     )
274
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/dvc/command/plots.py b/dvc/command/plots.py
--- a/dvc/command/plots.py
+++ b/dvc/command/plots.py
@@ -68,8 +68,12 @@
 
             if self.args.open:
                 import webbrowser
+                from platform import uname
 
-                opened = webbrowser.open(index_path)
+                if "Microsoft" in uname().release:
+                    url = Path(rel) / "index.html"
+
+                opened = webbrowser.open(url)
                 if not opened:
                     ui.error_write(
                         "Failed to open. Please try opening it manually."

{"golden_diff": "diff --git a/dvc/command/plots.py b/dvc/command/plots.py\n--- a/dvc/command/plots.py\n+++ b/dvc/command/plots.py\n@@ -68,8 +68,12 @@\n \n             if self.args.open:\n                 import webbrowser\n+                from platform import uname\n \n-                opened = webbrowser.open(index_path)\n+                if \"Microsoft\" in uname().release:\n+                    url = Path(rel) / \"index.html\"\n+\n+                opened = webbrowser.open(url)\n                 if not opened:\n                     ui.error_write(\n                         \"Failed to open. Please try opening it manually.\"\n", "issue": "plots --open: not working on macOS\nWe use relpath to open files in the browser.\r\n\r\nhttps://github.com/iterative/dvc/blob/59cfc2c4a43e9b9d2fdb583da80d24e82ae39c26/dvc/command/plots.py#L60\r\n\r\nThis is mostly done to support `wsl`, and the fact that all other Platform seem to work, if it's relative or absolute.\r\n\r\nThe reason why it does not work is because `web browser.open` messes up. \ud83e\udd26\ud83c\udffc \r\nhttps://github.com/python/cpython/blob/39dd141a4ba68bbb38fd00a65cdcff711acdafb5/Lib/webbrowser.py#L638-L639\nplots --open: not working on macOS\nWe use relpath to open files in the browser.\r\n\r\nhttps://github.com/iterative/dvc/blob/59cfc2c4a43e9b9d2fdb583da80d24e82ae39c26/dvc/command/plots.py#L60\r\n\r\nThis is mostly done to support `wsl`, and the fact that all other Platform seem to work, if it's relative or absolute.\r\n\r\nThe reason why it does not work is because `web browser.open` messes up. \ud83e\udd26\ud83c\udffc \r\nhttps://github.com/python/cpython/blob/39dd141a4ba68bbb38fd00a65cdcff711acdafb5/Lib/webbrowser.py#L638-L639\n", "before_files": [{"content": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link, fix_subparsers\nfrom dvc.exceptions import DvcException\nfrom dvc.render.utils import find_vega, render\nfrom dvc.ui import ui\nfrom dvc.utils import format_link\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdPlots(CmdBase):\n    def _func(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def _props(self):\n        from dvc.schema import PLOT_PROPS\n\n        # Pass only props specified by user, to not shadow ones from plot def\n        props = {p: getattr(self.args, p) for p in PLOT_PROPS}\n        return {k: v for k, v in props.items() if v is not None}\n\n    def run(self):\n        from pathlib import Path\n\n        if self.args.show_vega:\n            if not self.args.targets:\n                logger.error(\"please specify a target for `--show-vega`\")\n                return 1\n            if len(self.args.targets) > 1:\n                logger.error(\n                    \"you can only specify one target for `--show-vega`\"\n                )\n                return 1\n\n        try:\n            plots_data = self._func(\n                targets=self.args.targets, props=self._props()\n            )\n\n            if not plots_data:\n                ui.error_write(\n                    \"No plots were loaded, \"\n                    \"visualization file will not be created.\"\n                )\n\n            if self.args.show_vega:\n                target = self.args.targets[0]\n                plot_json = find_vega(self.repo, plots_data, target)\n                if plot_json:\n                    ui.write(plot_json)\n                return 0\n\n            rel: str = self.args.out or \"dvc_plots\"\n            path: Path = (Path.cwd() / rel).resolve()\n            index_path = render(\n                self.repo,\n                plots_data,\n                path=path,\n                html_template_path=self.args.html_template,\n            )\n\n            assert index_path.is_absolute()\n            url = index_path.as_uri()\n            ui.write(url)\n\n            if self.args.open:\n                import webbrowser\n\n                opened = webbrowser.open(index_path)\n                if not opened:\n                    ui.error_write(\n                        \"Failed to open. Please try opening it manually.\"\n                    )\n                    return 1\n            return 0\n\n        except DvcException:\n            logger.exception(\"\")\n            return 1\n\n\nclass CmdPlotsShow(CmdPlots):\n    UNINITIALIZED = True\n\n    def _func(self, *args, **kwargs):\n        return self.repo.plots.show(*args, **kwargs)\n\n\nclass CmdPlotsDiff(CmdPlots):\n    UNINITIALIZED = True\n\n    def _func(self, *args, **kwargs):\n        return self.repo.plots.diff(\n            *args,\n            revs=self.args.revisions,\n            experiment=self.args.experiment,\n            **kwargs,\n        )\n\n\nclass CmdPlotsModify(CmdPlots):\n    def run(self):\n        self.repo.plots.modify(\n            self.args.target, props=self._props(), unset=self.args.unset\n        )\n        return 0\n\n\ndef add_parser(subparsers, parent_parser):\n    PLOTS_HELP = (\n        \"Commands to visualize and compare plot metrics in structured files \"\n        \"(JSON, YAML, CSV, TSV).\"\n    )\n\n    plots_parser = subparsers.add_parser(\n        \"plots\",\n        parents=[parent_parser],\n        description=append_doc_link(PLOTS_HELP, \"plots\"),\n        help=PLOTS_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_subparsers = plots_parser.add_subparsers(\n        dest=\"cmd\",\n        help=\"Use `dvc plots CMD --help` to display command-specific help.\",\n    )\n\n    fix_subparsers(plots_subparsers)\n\n    SHOW_HELP = \"Generate plots from metrics files.\"\n    plots_show_parser = plots_subparsers.add_parser(\n        \"show\",\n        parents=[parent_parser],\n        description=append_doc_link(SHOW_HELP, \"plots/show\"),\n        help=SHOW_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_show_parser.add_argument(\n        \"targets\",\n        nargs=\"*\",\n        help=\"Files to visualize (supports any file, \"\n        \"even when not found as `plots` in `dvc.yaml`). \"\n        \"Shows all plots by default.\",\n    ).complete = completion.FILE\n    _add_props_arguments(plots_show_parser)\n    _add_output_arguments(plots_show_parser)\n    plots_show_parser.set_defaults(func=CmdPlotsShow)\n\n    PLOTS_DIFF_HELP = (\n        \"Show multiple versions of plot metrics \"\n        \"by plotting them in a single image.\"\n    )\n    plots_diff_parser = plots_subparsers.add_parser(\n        \"diff\",\n        parents=[parent_parser],\n        description=append_doc_link(PLOTS_DIFF_HELP, \"plots/diff\"),\n        help=PLOTS_DIFF_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_diff_parser.add_argument(\n        \"--targets\",\n        nargs=\"*\",\n        help=(\n            \"Specific plots file(s) to visualize \"\n            \"(even if not found as `plots` in `dvc.yaml`). \"\n            \"Shows all tracked plots by default.\"\n        ),\n        metavar=\"<paths>\",\n    ).complete = completion.FILE\n    plots_diff_parser.add_argument(\n        \"-e\",\n        \"--experiment\",\n        action=\"store_true\",\n        default=False,\n        help=argparse.SUPPRESS,\n    )\n    plots_diff_parser.add_argument(\n        \"revisions\", nargs=\"*\", default=None, help=\"Git commits to plot from\"\n    )\n    _add_props_arguments(plots_diff_parser)\n    _add_output_arguments(plots_diff_parser)\n    plots_diff_parser.set_defaults(func=CmdPlotsDiff)\n\n    PLOTS_MODIFY_HELP = (\n        \"Modify display properties of data-series plots \"\n        \"(has no effect on image-type plots).\"\n    )\n    plots_modify_parser = plots_subparsers.add_parser(\n        \"modify\",\n        parents=[parent_parser],\n        description=append_doc_link(PLOTS_MODIFY_HELP, \"plots/modify\"),\n        help=PLOTS_MODIFY_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_modify_parser.add_argument(\n        \"target\", help=\"Metric file to set properties to\"\n    ).complete = completion.FILE\n    _add_props_arguments(plots_modify_parser)\n    plots_modify_parser.add_argument(\n        \"--unset\",\n        nargs=\"*\",\n        metavar=\"<property>\",\n        help=\"Unset one or more display properties.\",\n    )\n    plots_modify_parser.set_defaults(func=CmdPlotsModify)\n\n\ndef _add_props_arguments(parser):\n    parser.add_argument(\n        \"-t\",\n        \"--template\",\n        nargs=\"?\",\n        default=None,\n        help=(\n            \"Special JSON or HTML schema file to inject with the data. \"\n            \"See {}\".format(\n                format_link(\"https://man.dvc.org/plots#plot-templates\")\n            )\n        ),\n        metavar=\"<path>\",\n    ).complete = completion.FILE\n    parser.add_argument(\n        \"-x\", default=None, help=\"Field name for X axis.\", metavar=\"<field>\"\n    )\n    parser.add_argument(\n        \"-y\", default=None, help=\"Field name for Y axis.\", metavar=\"<field>\"\n    )\n    parser.add_argument(\n        \"--no-header\",\n        action=\"store_false\",\n        dest=\"header\",\n        default=None,  # Use default None to distinguish when it's not used\n        help=\"Provided CSV or TSV datafile does not have a header.\",\n    )\n    parser.add_argument(\n        \"--title\", default=None, metavar=\"<text>\", help=\"Plot title.\"\n    )\n    parser.add_argument(\n        \"--x-label\", default=None, help=\"X axis label\", metavar=\"<text>\"\n    )\n    parser.add_argument(\n        \"--y-label\", default=None, help=\"Y axis label\", metavar=\"<text>\"\n    )\n\n\ndef _add_output_arguments(parser):\n    parser.add_argument(\n        \"-o\",\n        \"--out\",\n        default=None,\n        help=\"Destination path to save plots to\",\n        metavar=\"<path>\",\n    ).complete = completion.DIR\n    parser.add_argument(\n        \"--show-vega\",\n        action=\"store_true\",\n        default=False,\n        help=\"Show output in Vega format.\",\n    )\n    parser.add_argument(\n        \"--open\",\n        action=\"store_true\",\n        default=False,\n        help=\"Open plot file directly in the browser.\",\n    )\n    parser.add_argument(\n        \"--html-template\",\n        default=None,\n        help=\"Custom HTML template for VEGA visualization.\",\n        metavar=\"<path>\",\n    )\n", "path": "dvc/command/plots.py"}], "after_files": [{"content": "import argparse\nimport logging\n\nfrom dvc.command import completion\nfrom dvc.command.base import CmdBase, append_doc_link, fix_subparsers\nfrom dvc.exceptions import DvcException\nfrom dvc.render.utils import find_vega, render\nfrom dvc.ui import ui\nfrom dvc.utils import format_link\n\nlogger = logging.getLogger(__name__)\n\n\nclass CmdPlots(CmdBase):\n    def _func(self, *args, **kwargs):\n        raise NotImplementedError\n\n    def _props(self):\n        from dvc.schema import PLOT_PROPS\n\n        # Pass only props specified by user, to not shadow ones from plot def\n        props = {p: getattr(self.args, p) for p in PLOT_PROPS}\n        return {k: v for k, v in props.items() if v is not None}\n\n    def run(self):\n        from pathlib import Path\n\n        if self.args.show_vega:\n            if not self.args.targets:\n                logger.error(\"please specify a target for `--show-vega`\")\n                return 1\n            if len(self.args.targets) > 1:\n                logger.error(\n                    \"you can only specify one target for `--show-vega`\"\n                )\n                return 1\n\n        try:\n            plots_data = self._func(\n                targets=self.args.targets, props=self._props()\n            )\n\n            if not plots_data:\n                ui.error_write(\n                    \"No plots were loaded, \"\n                    \"visualization file will not be created.\"\n                )\n\n            if self.args.show_vega:\n                target = self.args.targets[0]\n                plot_json = find_vega(self.repo, plots_data, target)\n                if plot_json:\n                    ui.write(plot_json)\n                return 0\n\n            rel: str = self.args.out or \"dvc_plots\"\n            path: Path = (Path.cwd() / rel).resolve()\n            index_path = render(\n                self.repo,\n                plots_data,\n                path=path,\n                html_template_path=self.args.html_template,\n            )\n\n            assert index_path.is_absolute()\n            url = index_path.as_uri()\n            ui.write(url)\n\n            if self.args.open:\n                import webbrowser\n                from platform import uname\n\n                if \"Microsoft\" in uname().release:\n                    url = Path(rel) / \"index.html\"\n\n                opened = webbrowser.open(url)\n                if not opened:\n                    ui.error_write(\n                        \"Failed to open. Please try opening it manually.\"\n                    )\n                    return 1\n            return 0\n\n        except DvcException:\n            logger.exception(\"\")\n            return 1\n\n\nclass CmdPlotsShow(CmdPlots):\n    UNINITIALIZED = True\n\n    def _func(self, *args, **kwargs):\n        return self.repo.plots.show(*args, **kwargs)\n\n\nclass CmdPlotsDiff(CmdPlots):\n    UNINITIALIZED = True\n\n    def _func(self, *args, **kwargs):\n        return self.repo.plots.diff(\n            *args,\n            revs=self.args.revisions,\n            experiment=self.args.experiment,\n            **kwargs,\n        )\n\n\nclass CmdPlotsModify(CmdPlots):\n    def run(self):\n        self.repo.plots.modify(\n            self.args.target, props=self._props(), unset=self.args.unset\n        )\n        return 0\n\n\ndef add_parser(subparsers, parent_parser):\n    PLOTS_HELP = (\n        \"Commands to visualize and compare plot metrics in structured files \"\n        \"(JSON, YAML, CSV, TSV).\"\n    )\n\n    plots_parser = subparsers.add_parser(\n        \"plots\",\n        parents=[parent_parser],\n        description=append_doc_link(PLOTS_HELP, \"plots\"),\n        help=PLOTS_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_subparsers = plots_parser.add_subparsers(\n        dest=\"cmd\",\n        help=\"Use `dvc plots CMD --help` to display command-specific help.\",\n    )\n\n    fix_subparsers(plots_subparsers)\n\n    SHOW_HELP = \"Generate plots from metrics files.\"\n    plots_show_parser = plots_subparsers.add_parser(\n        \"show\",\n        parents=[parent_parser],\n        description=append_doc_link(SHOW_HELP, \"plots/show\"),\n        help=SHOW_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_show_parser.add_argument(\n        \"targets\",\n        nargs=\"*\",\n        help=\"Files to visualize (supports any file, \"\n        \"even when not found as `plots` in `dvc.yaml`). \"\n        \"Shows all plots by default.\",\n    ).complete = completion.FILE\n    _add_props_arguments(plots_show_parser)\n    _add_output_arguments(plots_show_parser)\n    plots_show_parser.set_defaults(func=CmdPlotsShow)\n\n    PLOTS_DIFF_HELP = (\n        \"Show multiple versions of plot metrics \"\n        \"by plotting them in a single image.\"\n    )\n    plots_diff_parser = plots_subparsers.add_parser(\n        \"diff\",\n        parents=[parent_parser],\n        description=append_doc_link(PLOTS_DIFF_HELP, \"plots/diff\"),\n        help=PLOTS_DIFF_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_diff_parser.add_argument(\n        \"--targets\",\n        nargs=\"*\",\n        help=(\n            \"Specific plots file(s) to visualize \"\n            \"(even if not found as `plots` in `dvc.yaml`). \"\n            \"Shows all tracked plots by default.\"\n        ),\n        metavar=\"<paths>\",\n    ).complete = completion.FILE\n    plots_diff_parser.add_argument(\n        \"-e\",\n        \"--experiment\",\n        action=\"store_true\",\n        default=False,\n        help=argparse.SUPPRESS,\n    )\n    plots_diff_parser.add_argument(\n        \"revisions\", nargs=\"*\", default=None, help=\"Git commits to plot from\"\n    )\n    _add_props_arguments(plots_diff_parser)\n    _add_output_arguments(plots_diff_parser)\n    plots_diff_parser.set_defaults(func=CmdPlotsDiff)\n\n    PLOTS_MODIFY_HELP = (\n        \"Modify display properties of data-series plots \"\n        \"(has no effect on image-type plots).\"\n    )\n    plots_modify_parser = plots_subparsers.add_parser(\n        \"modify\",\n        parents=[parent_parser],\n        description=append_doc_link(PLOTS_MODIFY_HELP, \"plots/modify\"),\n        help=PLOTS_MODIFY_HELP,\n        formatter_class=argparse.RawDescriptionHelpFormatter,\n    )\n    plots_modify_parser.add_argument(\n        \"target\", help=\"Metric file to set properties to\"\n    ).complete = completion.FILE\n    _add_props_arguments(plots_modify_parser)\n    plots_modify_parser.add_argument(\n        \"--unset\",\n        nargs=\"*\",\n        metavar=\"<property>\",\n        help=\"Unset one or more display properties.\",\n    )\n    plots_modify_parser.set_defaults(func=CmdPlotsModify)\n\n\ndef _add_props_arguments(parser):\n    parser.add_argument(\n        \"-t\",\n        \"--template\",\n        nargs=\"?\",\n        default=None,\n        help=(\n            \"Special JSON or HTML schema file to inject with the data. \"\n            \"See {}\".format(\n                format_link(\"https://man.dvc.org/plots#plot-templates\")\n            )\n        ),\n        metavar=\"<path>\",\n    ).complete = completion.FILE\n    parser.add_argument(\n        \"-x\", default=None, help=\"Field name for X axis.\", metavar=\"<field>\"\n    )\n    parser.add_argument(\n        \"-y\", default=None, help=\"Field name for Y axis.\", metavar=\"<field>\"\n    )\n    parser.add_argument(\n        \"--no-header\",\n        action=\"store_false\",\n        dest=\"header\",\n        default=None,  # Use default None to distinguish when it's not used\n        help=\"Provided CSV or TSV datafile does not have a header.\",\n    )\n    parser.add_argument(\n        \"--title\", default=None, metavar=\"<text>\", help=\"Plot title.\"\n    )\n    parser.add_argument(\n        \"--x-label\", default=None, help=\"X axis label\", metavar=\"<text>\"\n    )\n    parser.add_argument(\n        \"--y-label\", default=None, help=\"Y axis label\", metavar=\"<text>\"\n    )\n\n\ndef _add_output_arguments(parser):\n    parser.add_argument(\n        \"-o\",\n        \"--out\",\n        default=None,\n        help=\"Destination path to save plots to\",\n        metavar=\"<path>\",\n    ).complete = completion.DIR\n    parser.add_argument(\n        \"--show-vega\",\n        action=\"store_true\",\n        default=False,\n        help=\"Show output in Vega format.\",\n    )\n    parser.add_argument(\n        \"--open\",\n        action=\"store_true\",\n        default=False,\n        help=\"Open plot file directly in the browser.\",\n    )\n    parser.add_argument(\n        \"--html-template\",\n        default=None,\n        help=\"Custom HTML template for VEGA visualization.\",\n        metavar=\"<path>\",\n    )\n", "path": "dvc/command/plots.py"}]}