#5956: image dimensions for show() are in inches
----------------------------------------------------------------+-----------
Reporter: mvngu |
Owner: was
Type: defect |
Status: needs_work
Priority: minor |
Milestone: sage-5.6
Component: graphics |
Resolution:
Keywords: image dimensions, figsize, beginner | Work
issues:
Report Upstream: None of the above - read trac for reasoning. |
Reviewers: Karl-Dieter Crisman
Authors: Emily Chen | Merged
in:
Dependencies: |
Stopgaps:
----------------------------------------------------------------+-----------
Comment (by ppurka):
Thanks for the update. There is one more thing that I overlooked earlier.
The documentation should mention that the number `32768` is in dots per
inch. Maybe the text of `ValueError` should also end in '''32768 dots per
inch'''.
{{{
sage: e.show(figsize=[328,10],dpi=100)
ValueError: width and height must each be below 32768 dots per inch.
}}}
I think the following modification to the `figsize` documentation is
warranted.
{{{
- ``figsize`` - (default: [8.0,6.0]) [width, height] inches. The maximum
value
of each of the width and the height can be 327 inches, at the default
``dpi``
of 100 dpi, which is just shy of the maximum allowed value of 32768 dots
per inch.
}}}
Then, the test should have the following description:
{{{
The figsize width and height parameters must be less than 328
inches each,
corresponding to the maximum allowed dpi of 32768.::
}}}
This will make the number 32768 more clear to anyone who is curious what
that number means in the `ValueError`.
I am unable to replicate your matplotlib example. A figure doesn't seem to
have a `show()` attribute. However, the following example successfully
crashes matplotlib.
{{{
~» ulimit -v 2000000
~» sage -ipython
Python 2.7.3 (default, Dec 30 2012, 21:34:30)
Type "copyright", "credits" or "license" for more information.
IPython 0.10.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: from matplotlib import pyplot
In [2]: pyplot.figure(figsize=[232,232])
Out[2]: <matplotlib.figure.Figure object at 0x12ba950>
In [3]: pyplot.savefig('/tmp/a.png')
...
RuntimeError: Could not allocate memory for image
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5956#comment:11>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.