def plot_expectations(self, ax: plt.Axes | None = None, **plot_kwargs: Any) -> plt.Axes:
        """Plots the expectation values of Pauli operators versus delay time.

        Args:
            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 containing the plot.
        """
        show_plot = not ax
        if show_plot:
            fig, ax = plt.subplots(1, 1, figsize=(8, 8))
        assert ax is not None
        ax.set_ylim(ymin=-2, ymax=2)

        # Plot different expectation values in different colors.
        ax.plot(
            self._expectation_pauli_x['delay_ns'],
            self._expectation_pauli_x['value'],
            'bo-',
            label='<X>',
            **plot_kwargs,
        )
        ax.plot(
            self._expectation_pauli_y['delay_ns'],
            self._expectation_pauli_y['value'],
            'go-',
            label='<Y>',
            **plot_kwargs,
        )

        ax.set_xlabel(r"Delay between initialization and measurement (nanoseconds)")
        ax.set_ylabel('Pauli Operator Expectation')
        ax.set_title('T2 Decay Pauli Expectations')
        ax.legend()
        if show_plot:
            fig.show()
        return ax
Plots the expectation values of Pauli operators versus delay time.

        Args:
            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 containing the plot.
        
cirq-core/cirq/experiments/t2_decay_experiment.py