def plot_histogram(
        self,
        target_error: str = 'pauli',
        ax: plt.Axes | None = None,
        kind: str = 'two_qubit',
        **plot_kwargs,
    ) -> plt.Axes:
        """plot a histogram of target error.

        Args:
            target_error: The error to draw. Must be one of 'xeb', 'pauli', or 'decay_constant'
            ax: the plt.Axes to plot on. If not given, a new figure is created,
                plotted on, and shown.
            kind: Whether to plot the single-qubit RB errors ('single_qubit') or the
                two-qubit inferred errors ('two_qubit') or both ('both').
            **plot_kwargs: Arguments to be passed to 'plt.Axes.plot'.

        Returns:
            The plt.Axes that was plotted on.

        Raises:
            ValueError: If
                - `kind` is not one of 'single_qubit', 'two_qubit', or 'both'.
                - `target_error` is not one of 'pauli', 'xeb', or 'decay_constant'
                - single qubit error is requested and `target_error` is not 'pauli'.
        """
        if kind not in ('single_qubit', 'two_qubit', 'both'):
            raise ValueError(
                f"kind must be one of 'single_qubit', 'two_qubit', or 'both', not {kind}"
            )
        if kind != 'two_qubit' and target_error != 'pauli':
            raise ValueError(f'{target_error} is not supported for single qubits')
        fig = None
        if ax is None:
            fig, ax = plt.subplots(1, 1, figsize=(8, 8))

        alpha = 0.5 if kind == 'both' else 1.0
        if kind == 'single_qubit' or kind == 'both':
            self.rb_result.plot_integrated_histogram(
                ax=ax, alpha=alpha, label='single qubit', color='green', **plot_kwargs
            )
        if kind == 'two_qubit' or kind == 'both':
            vis.integrated_histogram(
                data=self._target_errors(target_error),
                ax=ax,
                alpha=alpha,
                label='two qubit',
                color='blue',
                **plot_kwargs,
            )

        if fig is not None:
            fig.show(**plot_kwargs)
        return ax
plot a histogram of target error.

        Args:
            target_error: The error to draw. Must be one of 'xeb', 'pauli', or 'decay_constant'
            ax: the plt.Axes to plot on. If not given, a new figure is created,
                plotted on, and shown.
            kind: Whether to plot the single-qubit RB errors ('single_qubit') or the
                two-qubit inferred errors ('two_qubit') or both ('both').
            **plot_kwargs: Arguments to be passed to 'plt.Axes.plot'.

        Returns:
            The plt.Axes that was plotted on.

        Raises:
            ValueError: If
                - `kind` is not one of 'single_qubit', 'two_qubit', or 'both'.
                - `target_error` is not one of 'pauli', 'xeb', or 'decay_constant'
                - single qubit error is requested and `target_error` is not 'pauli'.
        
cirq-core/cirq/experiments/two_qubit_xeb.py