def plot_histograms(
        self,
        keys: Sequence[str],
        ax: plt.Axes | None = None,
        *,
        labels: Sequence[str] | None = None,
    ) -> plt.Axes:
        """Plots integrated histograms of metric values corresponding to keys

        Args:
            keys: List of metric keys for which an integrated histogram should be plot
            ax: The axis to plot on. If None, we generate one.
            labels: Optional label that will be used in the legend.

        Returns:
            The axis that was plotted on.

        Raises:
            ValueError: If the metric values are not single floats.
        """
        show_plot = not ax
        if ax is None:
            fig, ax = plt.subplots(1, 1)

        if isinstance(keys, str):
            keys = [keys]
        if not labels:
            labels = keys
        colors = ['b', 'r', 'k', 'g', 'c', 'm']
        for key, label, color in zip(keys, labels, cycle(colors)):
            metrics = self[key]
            if not all(len(k) == 1 for k in metrics.values()):
                raise ValueError(
                    'Histograms are only supported if all values in a metric '
                    + 'are single metric values.'
                    + f'{key} has metric values {metrics.values()}'
                )
            cirq.integrated_histogram(
                [self.value_to_float(v) for v in metrics.values()],
                ax,
                label=label,
                color=color,
                title=key.replace('_', ' ').title(),
            )
        if show_plot:
            fig.show()

        return ax
Plots integrated histograms of metric values corresponding to keys

        Args:
            keys: List of metric keys for which an integrated histogram should be plot
            ax: The axis to plot on. If None, we generate one.
            labels: Optional label that will be used in the legend.

        Returns:
            The axis that was plotted on.

        Raises:
            ValueError: If the metric values are not single floats.
        
cirq-google/cirq_google/engine/calibration.py