def save(self, path, width=None, height=None, scale=None, **kwargs):
        """Saves the plot as an image or HTML.

        Args:
            path: the path to write the image or HTML
            width (None): a desired width in pixels when saving as an image.
                By default, the layout width is used
            height (None): a desired height in pixels when saving as an image.
                By default, the layout height is used
            scale (None): a scale factor to apply to the layout dimensions. By
                default, this is 1.0
            **kwargs: keyword arguments for
                :meth:`plotly:plotly.graph_objects.Figure.to_image` or
                :meth:`plotly:plotly.graph_objects.Figure.write_html`
        """
        etau.ensure_basedir(path)

        if os.path.splitext(path)[1] == ".html":
            self._widget.write_html(path, **kwargs)
            return

        if width is None:
            width = self._widget.layout.width

        if height is None:
            height = self._widget.layout.height

        if scale is None:
            scale = 1.0

        self._widget.write_image(
            path, width=width, height=height, scale=scale, **kwargs
        )
Saves the plot as an image or HTML.

        Args:
            path: the path to write the image or HTML
            width (None): a desired width in pixels when saving as an image.
                By default, the layout width is used
            height (None): a desired height in pixels when saving as an image.
                By default, the layout height is used
            scale (None): a scale factor to apply to the layout dimensions. By
                default, this is 1.0
            **kwargs: keyword arguments for
                :meth:`plotly:plotly.graph_objects.Figure.to_image` or
                :meth:`plotly:plotly.graph_objects.Figure.write_html`
        
fiftyone/core/plots/plotly.py