#11691: scaling_term only appears in documentation
-----------------------------+----------------------------------------------
Reporter: iandrus | Owner: iandrus
Type: defect | Status: positive_review
Priority: minor | Milestone: sage-4.7.2
Component: graph theory | Keywords:
Work_issues: | Upstream: N/A
Reviewer: Nathann Cohen | Author: Ivan Andrus
Merged: | Dependencies:
-----------------------------+----------------------------------------------
Description changed by leif:
Old description:
> The scaling_term is documented in `Graph.plot?` but in fact does nothing.
> Moreover, if passed to to `Graph.show` it returns an error.
>
> {{{
> sage: search_src('scaling_term')
> graphs/generic_graph.py:12985: - ``scaling_term`` -- default is
> 0.05. if vertices are getting
> graphs/graph_plot.py:577: scaling_term -- default is 0.05. if
> vertices are getting chopped off,
> sage: Graph([[1,2]]).show(scaling_term=3)
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call
> last)
>
> /Users/gvol/<ipython console> in <module>()
>
> /Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
> packages/sage/graphs/generic_graph.pyc in show(self, **kwds)
> 13213 if kwds.has_key(kwd):
> 13214 plot_kwds[kwd] = kwds.pop(kwd)
> > 13215 self.plot(**plot_kwds).show(**kwds)
> 13216
> 13217 def plot3d(self, bgcolor=(1,1,1), vertex_colors=None,
> vertex_size=0.06,
>
> /Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
> packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
> 424 kwds[self.name + "options"] = suboptions
> 425
> --> 426 return func(*args, **kwds)
> 427
> 428 #Add the options specified by @options to the signature
> of the wrapped
>
> /Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
> packages/sage/plot/plot.pyc in show(self, **kwds)
> 1731 else:
> 1732 kwds.setdefault('filename',
> sage.misc.misc.tmp_filename() + '.png')
> -> 1733 self.save(**kwds)
> 1734 os.system('%s %s 2>/dev/null 1>/dev/null &'
> 1735 % (sage.misc.viewer.browser(),
> kwds['filename']))
>
> /Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
> packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
> 424 kwds[self.name + "options"] = suboptions
> 425
> --> 426 return func(*args, **kwds)
> 427
> 428 #Add the options specified by @options to the signature
> of the wrapped
>
> /Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
> packages/sage/plot/plot.pyc in save(self, filename, **kwds)
> 2451 SageObject.save(self, filename)
> 2452 else:
> -> 2453 figure = self.matplotlib(**options)
> 2454 # You can output in PNG, PS, EPS, PDF, or SVG format,
> depending on the file extension.
>
> 2455 # matplotlib looks at the file extension to see what
> the renderer should be.
>
> TypeError: matplotlib() got an unexpected keyword argument 'scaling_term'
> }}}
New description:
The scaling_term is documented in `Graph.plot?` but in fact does nothing.
Moreover, if passed to to `Graph.show` it returns an error.
{{{
sage: search_src('scaling_term')
graphs/generic_graph.py:12985: - ``scaling_term`` -- default is
0.05. if vertices are getting
graphs/graph_plot.py:577: scaling_term -- default is 0.05. if
vertices are getting chopped off,
sage: Graph([[1,2]]).show(scaling_term=3)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/gvol/<ipython console> in <module>()
/Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.pyc in show(self, **kwds)
13213 if kwds.has_key(kwd):
13214 plot_kwds[kwd] = kwds.pop(kwd)
> 13215 self.plot(**plot_kwds).show(**kwds)
13216
13217 def plot3d(self, bgcolor=(1,1,1), vertex_colors=None,
vertex_size=0.06,
/Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
424 kwds[self.name + "options"] = suboptions
425
--> 426 return func(*args, **kwds)
427
428 #Add the options specified by @options to the signature of
the wrapped
/Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
packages/sage/plot/plot.pyc in show(self, **kwds)
1731 else:
1732 kwds.setdefault('filename',
sage.misc.misc.tmp_filename() + '.png')
-> 1733 self.save(**kwds)
1734 os.system('%s %s 2>/dev/null 1>/dev/null &'
1735 % (sage.misc.viewer.browser(),
kwds['filename']))
/Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
packages/sage/misc/decorators.pyc in wrapper(*args, **kwds)
424 kwds[self.name + "options"] = suboptions
425
--> 426 return func(*args, **kwds)
427
428 #Add the options specified by @options to the signature of
the wrapped
/Users/gvol/vcs/cur-sage/local/lib/python2.6/site-
packages/sage/plot/plot.pyc in save(self, filename, **kwds)
2451 SageObject.save(self, filename)
2452 else:
-> 2453 figure = self.matplotlib(**options)
2454 # You can output in PNG, PS, EPS, PDF, or SVG format,
depending on the file extension.
2455 # matplotlib looks at the file extension to see what
the renderer should be.
TypeError: matplotlib() got an unexpected keyword argument 'scaling_term'
}}}
Apply [attachment:trac_11691_scaling_term.patch] to the Sage library.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11691#comment:3>
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.