Ticket #4529: trac_4529-patch6.patch

File trac_4529-patch6.patch, 7.7 KB (added by kcrisman, 9 years ago)
  • sage/plot/graphics.py

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1338312400 14400
    # Node ID 66d66bef166d2e406574beb621420e347b9e2a0b
    # Parent  cd4c4c49133b66cbfad7c039fa4dbf649b595b35
    Trac 4529 - the last typos and formatting changes!
    
    diff --git a/sage/plot/graphics.py b/sage/plot/graphics.py
    a b  
    9696
    9797class Graphics(SageObject):
    9898    """
    99     The Graphics object is an empty list of graphics objects It is
     99    The Graphics object is an empty list of graphics objects. It is
    100100    useful to use this object when initializing a for loop where
    101101    different graphics object will be added to the empty object.
    102102   
  • sage/plot/line.py

    diff --git a/sage/plot/line.py b/sage/plot/line.py
    a b  
    214214
    215215        EXAMPLES:
    216216
    217         We create a line, then grab the line primitive as \code{L[0]} and compute
     217        We create a line, then grab the line primitive as ``L[0]`` and compute
    218218        its length::
    219219
    220220            sage: L = line([(1,2), (3,-4), (2, 5), (1,2)])
     
    287287    r"""
    288288    Create the line through the given list of points.
    289289
    290     Type \code{line2d.options} for a dictionary of the default options for
     290    Type ``line2d.options`` for a dictionary of the default options for
    291291    lines.  You can change this to change the defaults for all future
    292     lines.  Use \code{line2d.reset()} to reset to the default options.
     292    lines.  Use ``line2d.reset()`` to reset to the default options.
    293293
    294294    INPUT:
    295295
     
    345345
    346346    EXAMPLES:
    347347
     348    A line with no points or one point::
     349
     350        sage: line([])      #returns an empty plot
     351        sage: line([(1,1)])
     352
     353    A line with a legend::
     354
     355        sage: line([(0,0),(1,1)], legend_label='line')
     356
     357    Extra options will get passed on to show(), as long as they are valid::
     358
     359        sage: line([(0,1), (3,4)], figsize=[10, 2])
     360        sage: line([(0,1), (3,4)]).show(figsize=[10, 2]) # These are equivalent
     361
     362    We can also use a logarithmic scale if the data will support it::
     363
     364        sage: line([(1,2),(2,4),(3,4),(4,8),(4.5,32)],scale='loglog',base=2)
     365
     366    Many more examples below!
     367
    348368    A blue conchoid of Nicomedes::
    349369 
    350370        sage: L = [[1+5*cos(pi/2+pi*i/100), tan(pi/2+pi*i/100)*(1+5*cos(pi/2+pi*i/100))] for i in range(1,100)]
     
    416436        sage: Q = polygon([(-x,y) for x,y in P[0]], rgbcolor=(0,0,1))
    417437        sage: G + P + Q   # show the plot
    418438
    419     A line with no points or one point::
    420 
    421         sage: line([])      #returns an empty plot
    422         sage: line([(1,1)])
    423 
    424     A line with a legend::
    425 
    426         sage: line([(0,0),(1,1)], legend_label='line')
    427 
    428     Extra options will get passed on to show(), as long as they are valid::
    429    
    430         sage: line([(0,1), (3,4)], figsize=[10, 2])
    431         sage: line([(0,1), (3,4)]).show(figsize=[10, 2]) # These are equivalent
    432439    """
    433440    from sage.plot.all import Graphics
    434441    from sage.plot.plot import xydata_from_point_list
  • sage/plot/plot.py

    diff --git a/sage/plot/plot.py b/sage/plot/plot.py
    a b  
    16781678
    16791679    .. warning::
    16801680
    1681         If ``plotjoined`` is `False` then the axis that is in log scale
     1681        If ``plotjoined`` is ``False`` then the axis that is in log scale
    16821682        must have all points strictly positive. For instance, the following
    16831683        plot will show no points in the figure since the points in the
    16841684        horizontal axis starts from `(0,1)`.
    16851685
    1686     ::
    1687 
    1688         sage: list_plot(yl, scale='loglog')         # both axes are log
    1689 
    1690     Instead this will work. We drop the point `(0,1)`.::
    1691 
    1692         sage: list_plot(zip(range(1,len(yl)), yl[1:]), scale='loglog')
     1686        ::
     1687
     1688            sage: list_plot(yl, scale='loglog')         # both axes are log
     1689
     1690        Instead this will work. We drop the point `(0,1)`.::
     1691
     1692            sage: list_plot(zip(range(1,len(yl)), yl[1:]), scale='loglog')
    16931693
    16941694    We use :func:`list_plot_loglog` and plot in a different base.::
    16951695
     
    18901890
    18911891    .. warning::
    18921892
    1893         If ``plotjoined`` is `False` then the axis that is in log scale
     1893        If ``plotjoined`` is ``False`` then the axis that is in log scale
    18941894        must have all points strictly positive. For instance, the following
    18951895        plot will show no points in the figure since the points in the
    18961896        horizontal axis starts from `(0,1)`.
    18971897
    1898     ::
    1899 
    1900         sage: yl = [2**k for k in range(20)]
    1901         sage: list_plot_loglog(yl)
    1902 
    1903     Instead this will work. We drop the point `(0,1)`.::
    1904 
    1905         sage: list_plot_loglog(zip(range(1,len(yl)), yl[1:]))
     1898        ::
     1899
     1900            sage: yl = [2**k for k in range(20)]
     1901            sage: list_plot_loglog(yl)
     1902
     1903        Instead this will work. We drop the point `(0,1)`.::
     1904
     1905            sage: list_plot_loglog(zip(range(1,len(yl)), yl[1:]))
    19061906
    19071907    """
    19081908    return list_plot(data, plotjoined=plotjoined, scale='loglog', **kwds)
     
    19351935
    19361936    .. warning::
    19371937
    1938         If ``plotjoined`` is `False` then the horizontal axis must have all
     1938        If ``plotjoined`` is ``False`` then the horizontal axis must have all
    19391939        points strictly positive. Otherwise the plot will come up empty.
    19401940        For instance the following plot contains a point at `(0,1)`.
    19411941
     1942        ::
     1943
     1944            sage: yl = [2**k for k in range(12)]
     1945            sage: list_plot_semilogx(yl) # plot is empty because of `(0,1)`
     1946
     1947        We remove `(0,1)` to fix this.::
     1948
     1949            sage: list_plot_semilogx(zip(range(1, len(yl)), yl[1:]))
     1950
    19421951    ::
    19431952
    1944         sage: yl = [2**k for k in range(12)]
    1945         sage: list_plot_semilogx(yl) # plot is empty because of `(0,1)`
    1946 
    1947     We remove `(0,1)` to fix this.::
    1948 
    1949         sage: list_plot_semilogx(zip(range(1, len(yl)), yl[1:]))
    1950 
    1951     ::
    1952 
    1953         sage: list_plot_semilogx(yl, base=2) # with base 2
     1953        sage: list_plot_semilogx([(1,2),(3,4),(3,-1),(25,3)], base=2) # with base 2
    19541954
    19551955    """
    19561956    return list_plot(data, plotjoined=plotjoined, scale='semilogx', **kwds)
     
    19821982
    19831983    .. warning::
    19841984
    1985         If ``plotjoined`` is `False` then the vertical axis must have all
     1985        If ``plotjoined`` is ``False`` then the vertical axis must have all
    19861986        points strictly positive. Otherwise the plot will come up empty.
    19871987        For instance the following plot contains a point at `(1,0)`.
    19881988
     1989        ::
     1990
     1991            sage: xl = [2**k for k in range(12)]; yl = range(len(xl))
     1992            sage: list_plot_semilogy(zip(xl,yl)) # plot empty due to (1,0)
     1993
     1994        We remove `(1,0)` to fix this.::
     1995
     1996            sage: list_plot_semilogy(zip(xl[1:],yl[1:]))
     1997
     1998
    19891999    ::
    19902000
    1991         sage: xl = [2**k for k in range(12)]; yl = range(len(xl))
    1992         sage: list_plot_semilogy(zip(xl,yl)) # plot empty due to (1,0)
    1993 
    1994     We remove `(1,0)` to fix this.::
    1995 
    1996         sage: list_plot_semilogy(zip(xl[1:],yl[1:]))
    1997 
    1998 
    1999     ::
    2000 
    2001         sage: list_plot_semilogy(yl, base=2) # with base 2
     2001        sage: list_plot_semilogy([2, 4, 6, 8, 16, 31], base=2) # with base 2
    20022002
    20032003    """
    20042004    return list_plot(data, plotjoined=plotjoined, scale='semilogy', **kwds)
  • sage/plot/point.py

    diff --git a/sage/plot/point.py b/sage/plot/point.py
    a b  
    357357        sage: point([(cos(theta), sin(theta)) for theta in srange(0, 2*pi, pi/8)], frame=True)
    358358        sage: point([(cos(theta), sin(theta)) for theta in srange(0, 2*pi, pi/8)]).show(frame=True) # These are equivalent
    359359
     360    For plotting data, we can use a logarithmic scale, as long as we are sure
     361    not to include any nonpositive points in the logarithmic direction::
     362
     363        sage: point([(1,2),(2,4),(3,4),(4,8),(4.5,32)],scale='semilogy',base=2)
     364
    360365    Since Sage Version 4.4 (ticket #8599), the size of a 2d point can be
    361366    given by the argument ``size`` instead of ``pointsize``. The argument
    362367    ``pointsize`` is still supported::