def plot_fitted_exponential(
        self, q0: cirq.GridQubit, q1: cirq.GridQubit, ax: plt.Axes | None = None, **plot_kwargs
    ) -> plt.Axes:
        """plot the fitted model to for xeb error of a qubit pair.

        Args:
            q0: first qubit.
            q1: second qubit.
            ax: the plt.Axes to plot on. If not given, a new figure is created,
                plotted on, and shown.
            **plot_kwargs: Arguments to be passed to 'plt.Axes.plot'.

        Returns:
            The plt.Axes that was plotted on.
        """
        show_plot = not ax
        if not isinstance(ax, plt.Axes):
            fig, ax = plt.subplots(1, 1, figsize=(8, 8))

        record = self._record(q0, q1)

        ax.axhline(1, color='grey', ls='--')
        ax.plot(record['cycle_depths'], record['fidelities'], 'o')
        depths = np.linspace(0, np.max(record['cycle_depths']))
        ax.plot(
            depths,
            exponential_decay(depths, a=record['a'], layer_fid=record['layer_fid']),
            label='estimated exponential decay',
            **plot_kwargs,
        )
        ax.set_title(f'{q0}-{q1}')
        ax.set_ylabel('Circuit fidelity')
        ax.set_xlabel('Cycle Depth $d$')
        ax.legend(loc='best')
        if show_plot:
            fig.show()
        return ax
plot the fitted model to for xeb error of a qubit pair.

        Args:
            q0: first qubit.
            q1: second qubit.
            ax: the plt.Axes to plot on. If not given, a new figure is created,
                plotted on, and shown.
            **plot_kwargs: Arguments to be passed to 'plt.Axes.plot'.

        Returns:
            The plt.Axes that was plotted on.
        
cirq-core/cirq/experiments/two_qubit_xeb.py