def plot(
        self, key: str, fig: mpl.figure.Figure | None = None
    ) -> tuple[mpl.figure.Figure, list[plt.Axes]]:
        """Plots a heatmap and an integrated histogram for the given key.

        Args:
            key: The metric key to plot a heatmap and integrated histogram for.
            fig: The figure to plot on. If none, we generate one.

        Returns:
            The figure and list of axis that was plotted on.

        Raises:
            ValueError if the key is not for one/two qubits metric or the metric
            values are not single floats.
        """
        show_plot = not fig
        if fig is None:
            fig = plt.figure()
        axs = cast(list[plt.Axes], fig.subplots(1, 2))
        self.heatmap(key).plot(axs[0])
        self.plot_histograms(key, axs[1])
        if show_plot:
            fig.show()
        return fig, axs
Plots a heatmap and an integrated histogram for the given key.

        Args:
            key: The metric key to plot a heatmap and integrated histogram for.
            fig: The figure to plot on. If none, we generate one.

        Returns:
            The figure and list of axis that was plotted on.

        Raises:
            ValueError if the key is not for one/two qubits metric or the metric
            values are not single floats.
        
cirq-google/cirq_google/engine/calibration.py