id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
5956	image dimensions for show() are in inches	mvngu	was	"As discussed at this [http://groups.google.com/group/sage-devel/browse_thread/thread/c411254b7bc0bb97 sage-devel thread], the optional argument {{{figsize}}} of the command {{{show()}}} needs to clearly state that the units of the image are in inches. As of Sage 3.4.1, the docstring for {{{show()}}} says:
{{{
- ``figsize``- [width, height] (same for square aspect)
}}}
which can be interpreted to mean that one can do something like {{{figsize=[w,h]}}}. But something like the following produces a segmentation fault:
{{{
[mvngu@sage ~]$ sage
----------------------------------------------------------------------
| Sage Version 3.4.1, Release Date: 2009-04-21                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: q = var(""q"")
sage: f(q) = (q^4 - q^2 + 1) * (q^4 + q^3 + q^2 + q + 1) * (q^4 - q^3 \
+ q^2 - q + 1) * (q^6 + q^5 + q^4 + q^3 + q^2 + q + 1) * (q^6 - q^5 + \
q^4 - q^3 + q^2 - q + 1) * (q^(20) - q^(18) - q^(14) - q^(12) + q^(10) \
- q^8 - q^6 - q^2 + 1)
sage: g(q) = q^8 * (q^4 + q^2 + 1)^2 * (q^4 + 1)^5
sage: p = complex_plot(f/g, (-2,2), (-2,2))
sage: p.show(figsize=[256,256])
}}}
while the following results in a {{{ValueError}}}:
{{{
----------------------------------------------------------------------
| Sage Version 3.4.1, Release Date: 2009-04-21                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: q = var(""q"")
sage: f(q) = (q^4 - q^2 + 1) * (q^4 + q^3 + q^2 + q + 1) * (q^4 - q^3 \
+ q^2 - q + 1) * (q^6 + q^5 + q^4 + q^3 + q^2 + q + 1) * (q^6 - q^5 + \
q^4 - q^3 + q^2 - q + 1) * (q^(20) - q^(18) - q^(14) - q^(12) + q^(10) \
- q^8 - q^6 - q^2 + 1)
sage: g(q) = q^8 * (q^4 + q^2 + 1)^2 * (q^4 + 1)^5
sage: p = complex_plot(f/g, (-2,2), (-2,2))
sage: p.show(figsize=[500,500])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...
ValueError: width and height must each be below 32768
}}}
Essentially, the documentation for {{{show()}}} needs to be updated, especially the optional arguments, to clearly explain the units of measurement of the width and height of the image size. Also, it would be a good idea to specify how one can pass in values for those dimensions. For example, can one do this {{{figsize=[124,124]}}}?

----

Apply [attachment:trac_5956_figsize_units.1.patch] and [attachment:trac_5956-reviewer.patch] to devel/sage."	defect	needs_work	minor	sage-5.10	graphics		image dimensions, figsize, beginner	kcrisman		None of the above - read trac for reasoning.	Karl-Dieter Crisman, Punarbasu Purkayastha	Emily Chen, Punarbasu Purkayastha, Karl-Dieter Crisman			
