#5956: image dimensions for show() are in inches
-------------------------------------+-------------------------------------
       Reporter:  mvngu              |        Owner:  was
           Type:  defect             |       Status:  needs_work
       Priority:  minor              |    Milestone:  sage-6.4
      Component:  graphics           |   Resolution:
       Keywords:  image dimensions,  |    Merged in:
  figsize, beginner                  |    Reviewers:  Karl-Dieter Crisman,
        Authors:  Emily Chen,        |  Punarbasu Purkayastha, Jeroen
  Punarbasu Purkayastha, Karl-       |  Demeyer
  Dieter Crisman                     |  Work issues:
Report Upstream:  None of the above  |       Commit:
  - read trac for reasoning.         |  16666594c6d72b767adc1f2e9e7118469ffa600a
         Branch:                     |     Stopgaps:
  u/kcrisman/figsize                 |
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by jdemeyer):

 * status:  needs_review => needs_work
 * reviewer:  Karl-Dieter Crisman, Punarbasu Purkayastha => Karl-Dieter
     Crisman, Punarbasu Purkayastha, Jeroen Demeyer


Comment:

 Is there a check that `len(figsize) == 2`?

 I would change the logic of those branches to
 {{{
 if figure is None:
     # add a good comment here
     ...
 elif isinstance(figsize, (list, tuple)):
     # figsize should be two positive numbers
     if len(figsize) != 2:
         raise ValueError('...')
     ...
 else:
     # figsize should be a single positive number
     figsize = float(figsize) # to pass to mpl
     if figsize <= 0:
         raise ValueError("figsize should be positive, not
 {0}".format(figsize))
     ...
 }}}

 And add a doctest for some non-float `figsize` argument like
 {{{
 sage: var('x')
 sage: ...figsize=x...
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/5956#comment:39>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to