cirq.draw_placements
Draw a visualization of placements from small_graph onto big_graph using Matplotlib.
cirq.draw_placements(
big_graph: nx.Graph,
small_graph: nx.Graph,
small_to_big_mappings: Sequence[Dict],
max_plots: int = 20,
axes: Optional[Sequence[plt.Axes]] = None,
tilted: bool = True,
bad_placement_callback: Optional[Callable[[plt.Axes, int], None]] = None
)
Used in the notebooks
The entire big_graph
will be drawn with default blue colored nodes. small_graph
nodes
and edges will be highlighted with a red color.
Args |
big_graph
|
A larger graph to draw with blue colored nodes.
|
small_graph
|
A smaller, sub-graph to highlight with red nodes and edges.
|
small_to_big_mappings
|
A sequence of mappings from small_graph nodes to big_graph
nodes.
|
max_plots
|
To prevent an explosion of open Matplotlib figures, we only show the first
max_plots plots.
|
axes
|
Optional list of matplotlib Axes to contain the drawings.
|
tilted
|
Whether to draw gridlike graphs in the ordinary cartesian or tilted plane.
|
bad_placement_callback
|
If provided, we check that the given mappings are valid. If not,
this callback is called. The callback should accept ax and i keyword arguments
for the current axis and mapping index, respectively.
|
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."],[],[]]