# HG changeset patch
# User Franco Saliola <saliola@gmail.com>
# Date 1368628306 14400
# Node ID 0225faa8eafc711453396ebbb37ef1f2b0eaab0a
# Parent 2d2c30311e54cc2e406cb16d2363d9827326c380
[mq]: trac_14141-documentation-for-plotting-fs.patch
diff --git a/sage/combinat/knutson_tao_puzzles.py b/sage/combinat/knutson_tao_puzzles.py
a
|
b
|
class KnutsonTaoPuzzleSolver(UniqueRepre |
1435 | 1435 | sage: f[1, 2] |
1436 | 1436 | 1/\0 0\/1 |
1437 | 1437 | |
| 1438 | |
| 1439 | There are various methods and options to display puzzle solutions. |
| 1440 | A single puzzle can be displayed using the plot method of the puzzle:: |
| 1441 | |
| 1442 | sage: ps = KnutsonTaoPuzzleSolver("H") |
| 1443 | sage: puzzle = ps('0101','1001')[0] |
| 1444 | sage: puzzle.plot() #not tested |
| 1445 | sage: puzzle.plot(style='fill') #not tested |
| 1446 | sage: puzzle.plot(style='edges') #not tested |
| 1447 | |
| 1448 | To plot several puzzle solutions, use the plot method of the puzzle |
| 1449 | solver:: |
| 1450 | |
| 1451 | sage: ps = KnutsonTaoPuzzleSolver('K') |
| 1452 | sage: solns = ps('0101', '0101') |
| 1453 | sage: ps.plot(solns) # not tested |
| 1454 | |
| 1455 | The code can also generate a PDF of a puzzle (using LaTeX and *tikz*):: |
| 1456 | |
| 1457 | sage: latex.extra_preamble(r'''\usepackage{tikz}''') |
| 1458 | sage: ps = KnutsonTaoPuzzleSolver('H') |
| 1459 | sage: solns = ps('0101', '0101') |
| 1460 | sage: view(solns[0], viewer='pdf', tightpage=True) # not tested |
| 1461 | |
| 1462 | |
1438 | 1463 | Below are examples of using each of the currently supported puzzles. |
1439 | 1464 | |
1440 | 1465 | Cohomology of the Grassmannian:: |
… |
… |
class KnutsonTaoPuzzleSolver(UniqueRepre |
1771 | 1796 | sage: ps.plot(solns) # not tested |
1772 | 1797 | """ |
1773 | 1798 | g = [p.plot() for p in puzzles] |
1774 | | # FIXME : is this a bug in Sage or my mistake? |
1775 | 1799 | m = len([gg.axes(False) for gg in g]) |
1776 | 1800 | return graphics_array(g, (m+3)/4, 4) |
1777 | 1801 | |