#5956: image dimensions for show() are in inches
-------------------------------------+-------------------------------------
Reporter: mvngu | Owner: was
Type: defect | Status: needs_review
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
Punarbasu Purkayastha, Karl- | Work issues:
Dieter Crisman | Commit:
Report Upstream: None of the above | 47c705c6ee6ab969ec70eb6ed1628e56b59042fe
- read trac for reasoning. | Stopgaps:
Branch: |
u/kcrisman/figsize |
Dependencies: |
-------------------------------------+-------------------------------------
Description changed by jdemeyer:
Old description:
> 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.
New description:
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]}}}?
--
--
Ticket URL: <http://trac.sagemath.org/ticket/5956#comment:33>
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.