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.
|