Ticket #5956: only_for_review.patch

File only_for_review.patch, 4.1 KB (added by ppurka, 8 years ago)

not to be merged. only for review.

  • trac_5956_figsize_units.

    old new  
    11# HG changeset patch
    22# User Emily Chen <emchennyc@gmail.com>
    33# Date 1357396763 18000
    4 # Node ID 1da5be6f003d21a5676dce103b69b750e7663f93
     4# Node ID af0f1570723397884adb89e31dbcba3cb486a1a9
    55# Parent  5149624d99e0a7de3dd1d1465092a4a842a30e16
    66Trac #5956 Graphics object show() doc explains figsize dimension is inches; added doctest for max figsize and figsize values that cause segfault
    77
     
    1616 
    1717 """
    1818 
    19 @@ -1272,9 +1273,9 @@
     19@@ -1272,9 +1273,12 @@
    2020 
    2121         - ``filename`` - (default: None) string
    2222 
     
    2525-        - ``figsize`` - [width, height]
    2626+        - ``dpi`` - (default: 100) dots per inch
    2727+
    28 +        - ``figsize`` - (default: [8.0,6.0]) [width, height] inches
     28+        - ``figsize`` - (default: [8.0,6.0]) [width, height] inches. The
     29+          maximum value of each of the width and the height can be 327
     30+          inches, at the default ``dpi`` of 100 dpi, which is just shy of
     31+          the maximum allowed value of 32768 dots per inch.
    2932 
    3033         - ``fig_tight`` - (default: True) whether to clip the drawing
    3134           tightly around drawn objects.  If True, then the resulting
    32 @@ -1459,9 +1460,12 @@
     35@@ -1455,13 +1459,16 @@
     36               your own tick formatter using the option ``tick_formatter``.
     37 
     38         EXAMPLES::
     39-       
     40+
    3341             sage: c = circle((1,1), 1, color='red')
    3442             sage: c.show(xmin=-1, xmax=3, ymin=-1, ymax=3)
    35         
     43-       
    3644-        You could also just make the picture larger by changing ``figsize``::
    3745-
    3846-            sage: c.show(figsize=8, xmin=-1, xmax=3, ymin=-1, ymax=3)
    39 +        You can make the picture larger by changing ``figsize`` with width, height each having a maximum value
    40 +        of 327 inches at default dpi::
    4147+
    42 +            sage: e = ellipse((0,0),4,1)
    43 +            sage: e.show(figsize=[327,10],dpi=100)
    44 +            sage: e.show(figsize=[328,10],dpi=80)
     48+        You can make the picture larger by changing ``figsize`` with width,
     49+        height each having a maximum value of 327 inches at default dpi::
     50+
     51+            sage: p = ellipse((0,0),4,1)
     52+            sage: p.show(figsize=[327,10],dpi=100)
     53+            sage: p.show(figsize=[328,10],dpi=80)
    4554 
    4655         You can turn off the drawing of the axes::
    4756 
    48 @@ -1750,6 +1754,35 @@
     57@@ -1750,6 +1757,35 @@
    4958             ...
    5059             ValueError: 'title_pos' must be a list or tuple of two real numbers.
    5160 
    5261+        TESTS:
    5362+
    5463+        The figsize width and height parameters must be less than 328
    55 +        inches each.::
     64+        inches each, corresponding to the maximum allowed dpi of 32768.::
    5665+
    57 +            sage: e = ellipse((0,0),4,1)
    58 +            sage: e.show(figsize=[328,10],dpi=100)
     66+            sage: p = ellipse((0,0),4,1)
     67+            sage: p.show(figsize=[328,10],dpi=100)
    5968+            Traceback (most recent call last):
    6069+            ...
    6170+            ValueError: width and height must each be below 32768
     
    6372+        The following test results in a segmentation fault and should not
    6473+        be doctested.::
    6574+
    66 +            sage: e = ellipse((0,0),4,1)
    67 +            sage: e.show(figsize=[232,232],dpi=100) # not tested
     75+            sage: p = ellipse((0,0),4,1)
     76+            sage: p.show(figsize=[232,232],dpi=100) # not tested
    6877+            Unhandled SIGSEGV: A segmentation fault occurred in Sage.
    6978+            This probably occurred because a *compiled* component of Sage
    7079+            has a bug in it and is not properly wrapped with sig_on(),
    7180+            sig_off(). You might want to run Sage under gdb with 'sage
    7281+            -gdb' to debug this.  Sage will now terminate.
    7382+
    74 +            sage: e.show(figsize=[327,181],dpi=100) # not tested
     83+            sage: p.show(figsize=[327,181],dpi=100) # not tested
    7584+            Unhandled SIGSEGV: A segmentation fault occurred in Sage.
    7685+            This probably occurred because a *compiled* component of Sage
    7786+            has a bug in it and is not properly wrapped with sig_on(),