Ticket #14141: trac_14141-documentation-for-plotting-fs.patch

File trac_14141-documentation-for-plotting-fs.patch, 1.9 KB (added by saliola, 8 years ago)
  • sage/combinat/knutson_tao_puzzles.py

    # 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 
    14351435        sage: f[1, 2]
    14361436        1/\0  0\/1
    14371437
     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
    14381463    Below are examples of using each of the currently supported puzzles.
    14391464
    14401465    Cohomology of the Grassmannian::
    class KnutsonTaoPuzzleSolver(UniqueRepre 
    17711796            sage: ps.plot(solns)        # not tested
    17721797        """
    17731798        g = [p.plot() for p in puzzles]
    1774         # FIXME : is this a bug in Sage or my mistake?
    17751799        m = len([gg.axes(False) for gg in g])
    17761800        return graphics_array(g, (m+3)/4, 4)
    17771801