Ticket #4529: trac_4529-final-fixes.patch

File trac_4529-final-fixes.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 534cc5c845d78525b1879c56efd35afacae188a1
    # Parent  1476880452ba4c833e6aca64af3ac74bba5932e7
    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  
    16541654
    16551655    .. warning::
    16561656
    1657         If ``plotjoined`` is `False` then the axis that is in log scale
     1657        If ``plotjoined`` is ``False`` then the axis that is in log scale
    16581658        must have all points strictly positive. For instance, the following
    16591659        plot will show no points in the figure since the points in the
    16601660        horizontal axis starts from `(0,1)`.
    16611661
    1662     ::
    1663 
    1664         sage: list_plot(yl, scale='loglog')         # both axes are log
    1665 
    1666     Instead this will work. We drop the point `(0,1)`.::
    1667 
    1668         sage: list_plot(zip(range(1,len(yl)), yl[1:]), scale='loglog')
     1662        ::
     1663
     1664            sage: list_plot(yl, scale='loglog')         # both axes are log
     1665
     1666        Instead this will work. We drop the point `(0,1)`.::
     1667
     1668            sage: list_plot(zip(range(1,len(yl)), yl[1:]), scale='loglog')
    16691669
    16701670    We use :func:`list_plot_loglog` and plot in a different base.::
    16711671
     
    18661866
    18671867    .. warning::
    18681868
    1869         If ``plotjoined`` is `False` then the axis that is in log scale
     1869        If ``plotjoined`` is ``False`` then the axis that is in log scale
    18701870        must have all points strictly positive. For instance, the following
    18711871        plot will show no points in the figure since the points in the
    18721872        horizontal axis starts from `(0,1)`.
    18731873
    1874     ::
    1875 
    1876         sage: yl = [2**k for k in range(20)]
    1877         sage: list_plot_loglog(yl)
    1878 
    1879     Instead this will work. We drop the point `(0,1)`.::
    1880 
    1881         sage: list_plot_loglog(zip(range(1,len(yl)), yl[1:]))
     1874        ::
     1875
     1876            sage: yl = [2**k for k in range(20)]
     1877            sage: list_plot_loglog(yl)
     1878
     1879        Instead this will work. We drop the point `(0,1)`.::
     1880
     1881            sage: list_plot_loglog(zip(range(1,len(yl)), yl[1:]))
    18821882
    18831883    """
    18841884    return list_plot(data, plotjoined=plotjoined, scale='loglog', **kwds)
     
    19111911
    19121912    .. warning::
    19131913
    1914         If ``plotjoined`` is `False` then the horizontal axis must have all
     1914        If ``plotjoined`` is ``False`` then the horizontal axis must have all
    19151915        points strictly positive. Otherwise the plot will come up empty.
    19161916        For instance the following plot contains a point at `(0,1)`.
    19171917
     1918        ::
     1919
     1920            sage: yl = [2**k for k in range(12)]
     1921            sage: list_plot_semilogx(yl) # plot is empty because of `(0,1)`
     1922
     1923        We remove `(0,1)` to fix this.::
     1924
     1925            sage: list_plot_semilogx(zip(range(1, len(yl)), yl[1:]))
     1926
    19181927    ::
    19191928
    1920         sage: yl = [2**k for k in range(12)]
    1921         sage: list_plot_semilogx(yl) # plot is empty because of `(0,1)`
    1922 
    1923     We remove `(0,1)` to fix this.::
    1924 
    1925         sage: list_plot_semilogx(zip(range(1, len(yl)), yl[1:]))
    1926 
    1927     ::
    1928 
    1929         sage: list_plot_semilogx(yl, base=2) # with base 2
     1929        sage: list_plot_semilogx([(1,2),(3,4),(3,-1),(25,3)], base=2) # with base 2
    19301930
    19311931    """
    19321932    return list_plot(data, plotjoined=plotjoined, scale='semilogx', **kwds)
     
    19581958
    19591959    .. warning::
    19601960
    1961         If ``plotjoined`` is `False` then the vertical axis must have all
     1961        If ``plotjoined`` is ``False`` then the vertical axis must have all
    19621962        points strictly positive. Otherwise the plot will come up empty.
    19631963        For instance the following plot contains a point at `(1,0)`.
    19641964
     1965        ::
     1966
     1967            sage: xl = [2**k for k in range(12)]; yl = range(len(xl))
     1968            sage: list_plot_semilogy(zip(xl,yl)) # plot empty due to (1,0)
     1969
     1970        We remove `(1,0)` to fix this.::
     1971
     1972            sage: list_plot_semilogy(zip(xl[1:],yl[1:]))
     1973
     1974
    19651975    ::
    19661976
    1967         sage: xl = [2**k for k in range(12)]; yl = range(len(xl))
    1968         sage: list_plot_semilogy(zip(xl,yl)) # plot empty due to (1,0)
    1969 
    1970     We remove `(1,0)` to fix this.::
    1971 
    1972         sage: list_plot_semilogy(zip(xl[1:],yl[1:]))
    1973 
    1974 
    1975     ::
    1976 
    1977         sage: list_plot_semilogy(yl, base=2) # with base 2
     1977        sage: list_plot_semilogy([2, 4, 6, 8, 16, 31], base=2) # with base 2
    19781978
    19791979    """
    19801980    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::