Did I find the right examples for you? yes no

# sympy.categories.XypicDiagramDrawer

All Samples(34)  |  Call(32)  |  Derive(0)  |  Import(2)
```Given a :class:`Diagram` and the corresponding
:class:`DiagramGrid`, produces the Xy-pic representation of the
diagram.

The most important method in this class is ``draw``.  Consider the
following triangle diagram:

>>> from sympy.categories import Object, NamedMorphism, Diagram
>>> from sympy.categories import DiagramGrid, XypicDiagramDrawer
>>> A = Object("A")(more...)
```

```from sympy.categories.diagram_drawing import _GrowableGrid, ArrowStringDescription
from sympy.categories import (DiagramGrid, Object, NamedMorphism,
Diagram, XypicDiagramDrawer, xypic_draw_diagram)
from sympy import FiniteSet

```
```    d = Diagram([f, g, h, i])
grid = DiagramGrid(d, layout="sequential")
drawer = XypicDiagramDrawer()
assert drawer.draw(d, grid) == "\\xymatrix{\n" \
"A \\ar[r]^{f} & B \\ar[r]^{g} & C \\ar[r]^{h} & D \\ar[r]^{i} & E \n" \
"}\n"

# The same diagram, transposed.
grid = DiagramGrid(d, layout="sequential", transpose=True)
drawer = XypicDiagramDrawer()
```
```    d = Diagram([f, g], {g * f: "unique"})
grid = DiagramGrid(d)
drawer = XypicDiagramDrawer()
assert drawer.draw(d, grid) == "\\xymatrix{\n" \
"A \\ar[d]_{g\\circ f} \\ar[r]^{f} & B \\ar[ld]^{g} \\\\\n" \
```
```    # The same diagram, transposed.
grid = DiagramGrid(d, transpose=True)
drawer = XypicDiagramDrawer()
assert drawer.draw(d, grid) == "\\xymatrix{\n" \
"A \\ar[r]^{g\\circ f} \\ar[d]_{f} & C \\\\\n" \
```

```from sympy.categories.diagram_drawing import _GrowableGrid, ArrowStringDescription
from sympy.categories import (DiagramGrid, Object, NamedMorphism,
Diagram, XypicDiagramDrawer, xypic_draw_diagram)
from sympy import FiniteSet

```
```    d = Diagram([f, g, h, i])
grid = DiagramGrid(d, layout="sequential")
drawer = XypicDiagramDrawer()
assert drawer.draw(d, grid) == "\\xymatrix{\n" \
"A \\ar[r]^{f} & B \\ar[r]^{g} & C \\ar[r]^{h} & D \\ar[r]^{i} & E \n" \
"}\n"

# The same diagram, transposed.
grid = DiagramGrid(d, layout="sequential", transpose=True)
drawer = XypicDiagramDrawer()
```
```    d = Diagram([f, g], {g * f: "unique"})
grid = DiagramGrid(d)
drawer = XypicDiagramDrawer()
assert drawer.draw(d, grid) == "\\xymatrix{\n" \
"A \\ar[d]_{g\\circ f} \\ar[r]^{f} & B \\ar[ld]^{g} \\\\\n" \
```
```    # The same diagram, transposed.
grid = DiagramGrid(d, transpose=True)
drawer = XypicDiagramDrawer()
assert drawer.draw(d, grid) == "\\xymatrix{\n" \
"A \\ar[r]^{g\\circ f} \\ar[d]_{f} & C \\\\\n" \
```