cirq.integrated_histogram
Plot the integrated histogram for an array of data.
cirq.integrated_histogram(
data: Union[Sequence[SupportsFloat], Mapping[Any, SupportsFloat]],
ax: Optional[plt.Axes] = None,
*,
cdf_on_x: bool = False,
axis_label: str = '',
semilog: bool = True,
median_line: bool = True,
median_label: Optional[str] = 'median',
mean_line: bool = False,
mean_label: Optional[str] = 'mean',
show_zero: bool = False,
title: Optional[str] = None,
**kwargs
) -> plt.Axes
Suppose the input is a list of gate fidelities. The x-axis of the plot will
be gate fidelity, and the y-axis will be the probability that a random gate
fidelity from the list is less than the x-value. It will look something like
this
1.0
| |
| ___|
| |
| _|
| |
| |
||_____________
0.0
Another way of saying this is that we assume the probability distribution
function (pdf) of gate fidelities is a set of equally weighted delta
functions at each value in the list. Then, the "integrated histogram"
is the cumulative distribution function (cdf) for this pdf.
Args |
data
|
Data to histogram. If the data is a Mapping , we histogram the
values. All nans will be removed.
|
ax
|
The axis to plot on. If None, we generate one.
|
cdf_on_x
|
If True, flip the axes compared the above example.
|
axis_label
|
Label for x axis (y-axis if cdf_on_x is True).
|
semilog
|
If True, force the x-axis to be logarithmic.
|
median_line
|
If True, draw a vertical line on the median value.
|
median_label
|
If drawing median line, optional label for it.
|
mean_line
|
If True, draw a vertical line on the mean value.
|
mean_label
|
If drawing mean line, optional label for it.
|
title
|
Title of the plot. If None, we assign "N={len(data)}".
|
show_zero
|
If True, moves the step plot up by one unit by prepending 0
to the data.
|
**kwargs
|
Kwargs to forward to ax.step() . Some examples are
color: Color of the line.
linestyle: Linestyle to use for the plot.
lw: linewidth for integrated histogram.
ms: marker size for a histogram trace.
label: An optional label which can be used in a legend.
|
Returns |
The axis that was plotted on.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]