# HG changeset patch
# User KarlDieter 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


96  96  
97  97  class Graphics(SageObject): 
98  98  """ 
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 
100  100  useful to use this object when initializing a for loop where 
101  101  different graphics object will be added to the empty object. 
102  102  
diff git a/sage/plot/line.py b/sage/plot/line.py
a

b


214  214  
215  215  EXAMPLES: 
216  216  
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 
218  218  its length:: 
219  219  
220  220  sage: L = line([(1,2), (3,4), (2, 5), (1,2)]) 
… 
… 

287  287  r""" 
288  288  Create the line through the given list of points. 
289  289  
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 
291  291  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. 
293  293  
294  294  INPUT: 
295  295  
… 
… 

345  345  
346  346  EXAMPLES: 
347  347  
 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  
348  368  A blue conchoid of Nicomedes:: 
349  369  
350  370  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)] 
… 
… 

416  436  sage: Q = polygon([(x,y) for x,y in P[0]], rgbcolor=(0,0,1)) 
417  437  sage: G + P + Q # show the plot 
418  438  
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 
432  439  """ 
433  440  from sage.plot.all import Graphics 
434  441  from sage.plot.plot import xydata_from_point_list 
diff git a/sage/plot/plot.py b/sage/plot/plot.py
a

b


1654  1654  
1655  1655  .. warning:: 
1656  1656  
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 
1658  1658  must have all points strictly positive. For instance, the following 
1659  1659  plot will show no points in the figure since the points in the 
1660  1660  horizontal axis starts from `(0,1)`. 
1661  1661  
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') 
1669  1669  
1670  1670  We use :func:`list_plot_loglog` and plot in a different base.:: 
1671  1671  
… 
… 

1866  1866  
1867  1867  .. warning:: 
1868  1868  
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 
1870  1870  must have all points strictly positive. For instance, the following 
1871  1871  plot will show no points in the figure since the points in the 
1872  1872  horizontal axis starts from `(0,1)`. 
1873  1873  
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:])) 
1882  1882  
1883  1883  """ 
1884  1884  return list_plot(data, plotjoined=plotjoined, scale='loglog', **kwds) 
… 
… 

1911  1911  
1912  1912  .. warning:: 
1913  1913  
1914   If ``plotjoined`` is `False` then the horizontal axis must have all 
 1914  If ``plotjoined`` is ``False`` then the horizontal axis must have all 
1915  1915  points strictly positive. Otherwise the plot will come up empty. 
1916  1916  For instance the following plot contains a point at `(0,1)`. 
1917  1917  
 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  
1918  1927  :: 
1919  1928  
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 
1930  1930  
1931  1931  """ 
1932  1932  return list_plot(data, plotjoined=plotjoined, scale='semilogx', **kwds) 
… 
… 

1958  1958  
1959  1959  .. warning:: 
1960  1960  
1961   If ``plotjoined`` is `False` then the vertical axis must have all 
 1961  If ``plotjoined`` is ``False`` then the vertical axis must have all 
1962  1962  points strictly positive. Otherwise the plot will come up empty. 
1963  1963  For instance the following plot contains a point at `(1,0)`. 
1964  1964  
 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  
1965  1975  :: 
1966  1976  
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 
1978  1978  
1979  1979  """ 
1980  1980  return list_plot(data, plotjoined=plotjoined, scale='semilogy', **kwds) 
diff git a/sage/plot/point.py b/sage/plot/point.py
a

b


357  357  sage: point([(cos(theta), sin(theta)) for theta in srange(0, 2*pi, pi/8)], frame=True) 
358  358  sage: point([(cos(theta), sin(theta)) for theta in srange(0, 2*pi, pi/8)]).show(frame=True) # These are equivalent 
359  359  
 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  
360  365  Since Sage Version 4.4 (ticket #8599), the size of a 2d point can be 
361  366  given by the argument ``size`` instead of ``pointsize``. The argument 
362  367  ``pointsize`` is still supported:: 