Ticket #4529: trac_4529-more-doc.patch

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

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1338249593 14400
    # Node ID f0c3f17c4285e8215a60147253efc99f05eff07a
    # Parent  2ef739a34aad82a8b845a12df367b2d79c8769b2
    [mq]: finalizelog
    
    diff --git a/sage/plot/graphics.py b/sage/plot/graphics.py
    a b  
    14261426
    14271427            sage: G.show(scale='semilogy', base=2) # y axis as powers of 2
    14281428
     1429        ::
     1430
    14291431            sage: G.show(scale='semilogy', base=(3,2)) # base ignored for x-axis
    14301432
    14311433        The scale can be also given as a 2-tuple or a 3-tuple.::
    14321434
    14331435            sage: G.show(scale=('loglog', 2)) # both x and y axes in base 2
    14341436
     1437        ::
     1438
    14351439            sage: G.show(scale=('loglog', 2, 3)) # x in base 2, y in base 3
    14361440
    14371441        The base need not be an integer, though it does have to be made
     
    14461450            sage: G = list_plot(map(lambda i: 10**i, range(10)))
    14471451            sage: G.show(scale='semilogy')
    14481452
     1453        ::
     1454
    14491455            sage: G = parametric_plot((x, x**2), (x, 1, 10))
    14501456            sage: G.show(scale='loglog')
    14511457
     1458        ::
     1459
    14521460            sage: disk((5,5), 4, (0, 3*pi/2)).show(scale='loglog',base=2)
    14531461
     1462        ::
     1463
    14541464            sage: x, y = var('x, y')
    14551465            sage: G =  plot_vector_field((2^x,y^2),(x,1,10),(y,1,100))
    14561466            sage: G.show(scale='semilogx',base=2)
  • sage/plot/plot.py

    diff --git a/sage/plot/plot.py b/sage/plot/plot.py
    a b  
    6262
    6363-  :func:`graphics_array`
    6464
     65-  The following log plotting functions:
     66
     67   - :func:`plot_loglog`
     68
     69   - :func:`plot_semilogx` and :func:`plot_semilogy`
     70
     71   - :func:`list_plot_loglog`
     72
     73   - :func:`list_plot_semilogx` and :func:`list_plot_semilogy`
     74
    6575
    6676The following miscellaneous Graphics functions are included:
    6777
     
    607617      logarithmic scale. The `semilogx` scale sets the horizontal axis
    608618      to logarithmic scale. The `semilogy` scale sets the vertical axis
    609619      to logarithmic scale. The `linear` scale is the default value
    610       when :class:`~sage.graphics.Graphics` is initialized.
     620      when :class:`~sage.plot.graphics.Graphics` is initialized.
    611621
    612622    - ``xmin`` - starting x value
    613623
     
    802812
    803813        sage: plot(exp, (1, 10), scale='semilogy') # log axis on vertical
    804814
     815    ::
     816
    805817        sage: plot_semilogy(exp, (1, 10)) # same thing
    806818
     819    ::
     820
    807821        sage: plot_loglog(exp, (1, 10), scale='loglog')   # both axes are log
    808822
     823    ::
     824
    809825        sage: plot(exp, (1, 10), scale='loglog', base=2) # base of log is 2
    810826
    811827    We can also change the scale of the axes in the graphics just before
     
    14081424        sage: parametric_plot( vector([t, t+1, t^2]), (t, 0, 1))
    14091425
    14101426    Plotting in logarithmic scale is possible with 2D plots. The keyword
    1411     ``aspect_ratio`` will be ignored if the scale is not `loglog` or
    1412     `linear`.::
     1427    ``aspect_ratio`` will be ignored if the scale is not ``'loglog'`` or
     1428    ``'linear'``.::
    14131429
    14141430        sage: parametric_plot((x, x**2), (x, 1, 10), scale='loglog')
    14151431
    14161432    We can also change the scale of the axes in the graphics just before
    14171433    displaying. In this case, the ``aspect_ratio`` must be specified as
    1418     `automatic` if the ``scale`` is set to `semilogx` or `semilogy`. For
     1434    ``'automatic'`` if the ``scale`` is set to ``'semilogx'`` or ``'semilogy'``. For
    14191435    other values of the ``scale`` parameter, any ``aspect_ratio`` can be
    14201436    used, or the keyword need not be provided.::
    14211437
     
    16151631
    16161632        sage: list_plot({22: 3365, 27: 3295, 37: 3135, 42: 3020, 47: 2880, 52: 2735, 57: 2550})
    16171633
    1618     Plotting in logarithmic scale is possible for 2D plots.::
     1634    Plotting in logarithmic scale is possible for 2D list plots.
     1635    There are two different syntaxes available::
    16191636
    16201637        sage: yl = [2**k for k in range(10)]
    16211638        sage: list_plot(yl, scale='semilogy')       # log axis on vertical
    16221639
     1640    ::
     1641
     1642        sage: list_plot_semilogy(yl)       # same
     1643
     1644    ::
     1645
    16231646        sage: list_plot(yl, scale='loglog')         # both axes are log
    16241647
    1625         sage: list_plot(yl, scale='loglog', base=2) # base of log is 2
     1648    ::
     1649
     1650        sage: list_plot_loglog(yl, base=2) # base of log is 2
    16261651
    16271652    We can also change the scale of the axes in the graphics just before
    16281653    displaying::
     
    16971722
    16981723        sage: plot_loglog(exp, (1,10)) # plot in loglog scale with base 10
    16991724
     1725    ::
     1726
    17001727        sage: plot_loglog(exp, (1,10), base=2) # with base 2 on both axes
    17011728
     1729    ::
     1730
    17021731        sage: plot_loglog(exp, (1,10), base=(2,3))
    17031732
    17041733    """
     
    17231752
    17241753        sage: plot_semilogx(exp, (1,10)) # plot in semilogx scale, base 10
    17251754
     1755    ::
     1756
    17261757        sage: plot_semilogx(exp, (1,10), base=2) # with base 2
    17271758
    17281759    """
     
    17471778
    17481779        sage: plot_semilogy(exp, (1,10)) # plot in semilogy scale, base 10
    17491780
     1781    ::
     1782
    17501783        sage: plot_semilogy(exp, (1,10), base=2) # with base 2
    17511784
    17521785    """
     
    17551788@options(base=10)
    17561789def list_plot_loglog(data, plotjoined=False, **kwds):
    17571790    """
    1758     Plot the `data` in 'loglog' scale, that is, both the horizontal and the
     1791    Plot the ``data`` in 'loglog' scale, that is, both the horizontal and the
    17591792    vertical axes will be in logarithmic scale.
    17601793
    17611794    INPUTS:
     
    17721805        sage: yl = [5**k for k in range(10)]; xl = [2**k for k in range(10)]
    17731806        sage: list_plot_loglog(zip(xl, yl)) # plot in loglog scale with base 10
    17741807
     1808    ::
     1809
    17751810        sage: list_plot_loglog(zip(xl, yl), base=2) # with base 2 on both axes
    17761811
     1812    ::
     1813
    17771814        sage: list_plot_loglog(zip(xl, yl), base=(2,5))
    17781815
    17791816    """
     
    17821819@options(base=10)
    17831820def list_plot_semilogx(data, plotjoined=False, **kwds):
    17841821    """
    1785     Plot `data` in 'semilogx' scale, that is, the horizontal axis will be
     1822    Plot ``data`` in 'semilogx' scale, that is, the horizontal axis will be
    17861823    in logarithmic scale.
    17871824
    17881825    INPUTS:
     
    17901827    - ``base`` -- (default: 10) the base of the logarithm. This must be
    17911828      greater than 1.
    17921829
    1793     For all other inputs, look at the documentation of :func:`plot`.
     1830    For all other inputs, look at the documentation of :func:`list_plot`.
    17941831
    17951832    EXAMPLES::
    17961833
    17971834        sage: yl = [5**k for k in range(10)]
    17981835        sage: list_plot_semilogx(yl) # plot in semilogx scale, base 10
    17991836
     1837    ::
     1838
    18001839        sage: list_plot_semilogx(yl, base=2) # with base 2
    18011840
    18021841    """
     
    18051844@options(base=10)
    18061845def list_plot_semilogy(data, plotjoined=False, **kwds):
    18071846    """
    1808     Plot `data` in 'semilogy' scale, that is, the vertical axis will be
     1847    Plot ``data`` in 'semilogy' scale, that is, the vertical axis will be
    18091848    in logarithmic scale.
    18101849
    18111850    INPUTS:
     
    18131852    - ``base`` -- (default: 10) the base of the logarithm. This must be
    18141853      greater than 1.
    18151854
    1816     For all other inputs, look at the documentation of :func:`plot`.
     1855    For all other inputs, look at the documentation of :func:`list_plot`.
    18171856
    18181857    EXAMPLES::
    18191858
    18201859        sage: yl = [5**k for k in range(10)]
    18211860        sage: list_plot_semilogy(yl) # plot in semilogy scale, base 10
    18221861
     1862    ::
     1863
    18231864        sage: list_plot_semilogy(yl, base=5) # with base 5
    18241865
    18251866    """