Ticket #12857: trac_12857-split_graphics_review-fh.patch

File trac_12857-split_graphics_review-fh.patch, 1.9 KB (added by hivert, 9 years ago)
  • sage/plot/graphics.py

    # HG changeset patch
    # User Florent Hivert <Florent.Hivert@univ-rouen.fr>
    # Date 1335446036 -7200
    # Node ID 0b785a869399427b8b308438a4301d81a8facf32
    # Parent  ae665db9fd6b4c608348ef6209bf580dcf9f11d6
    Review of Split off Graphics class from plot.py (silent sage -coverage)
    
    diff --git a/sage/plot/graphics.py b/sage/plot/graphics.py
    a b class Graphics(SageObject): 
    124124        sage: g = Graphics()
    125125        sage: g += sphere((1, 1, 1), 2)
    126126        sage: g.show()
     127
     128    We check that graphics can be pickled (we can't use equality on
     129    graphics so we just check that the load/dump cycle gives a
     130    :class:`Graphics` instance)::
     131
     132        sage: g = Graphics()
     133        sage: g2 = loads(dumps(g))
     134        sage: g2.show()
     135
     136    ::
     137
     138        sage: isinstance(g2, Graphics)
     139        True
    127140    """
    128141
    129142    def __init__(self):
    class GraphicsArray(SageObject): 
    22782291            sage: R = rainbow(6)
    22792292            sage: L = [plot(x^n,(x,0,1),color=R[n]) for n in range(6)]
    22802293            sage: G = graphics_array(L,2,3)
    2281             sage: G # plot shown is default
     2294            sage: G # plot shown is default (indirect doctest)
    22822295
    22832296        We can make commands not display their plots by default. ::
    22842297
    22852298            sage: show_default(False)
    2286             sage: graphics_array(L)
     2299            sage: graphics_array(L) # indirect doctest
    22872300            Graphics Array of size 1 x 6
    22882301            sage: show_default(True)
    22892302        """
  • sage/plot/plot.py

    diff --git a/sage/plot/plot.py b/sage/plot/plot.py
    a b def reshape(v, n, m): 
    16371637    TESTS::
    16381638
    16391639        sage: L = [plot(sin(k*x),(x,-pi,pi)) for k in [1..3]]
    1640         sage: graphics_array(L,0,-1)
     1640        sage: graphics_array(L,0,-1) # indirect doctest
    16411641        Traceback (most recent call last):
    16421642        ...
    16431643        AssertionError: array sizes must be positive