dwave_networkx.drawing.zephyr_layout.zephyr_node_placer_2d#
- zephyr_node_placer_2d(G, scale=1.0, center=None, dim=2)[source]#
Generates a function to convert Zephyr indices to plottable coordinates.
- Parameters:
G (NetworkX graph) – Zephyr graph or a subgraph of a Zephyr graph as produced by the
dwave_networkx.zephyr_graph()
function.scale (float (default 1.)) – Scale factor. If
scale
= 1, all positions fit within [0, 1] on the x-axis and [-1, 0] on the y-axis.center (None or array (default None)) – Coordinates of the top left corner.
dim (int (default 2)) – Number of dimensions. If
dim
> 2, all extra dimensions are set to 0.
- Returns:
xy_coords – Function that maps a Zephyr index
(u, w, k, j, z)
in a Zephyr lattice to plottable x- and y-coordinates.- Return type:
Function