#19451: Graph plot default options before first call to plot() fail
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-7.1
      Component:  documentation      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jmantysalo/graph_plot_default_options_before_first_call_to_plot___fail|  
2ccbf2b95d2ea3a1c132a3d6823b0fed6b70a81a
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by jmantysalo:

Old description:

> {{{
> sage: G = Graph({1:[2,3,4]})
> sage: sage.graphs.graph_plot.DEFAULT_PLOT_OPTIONS['vertex_shape'] = 's'
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call
> last)
> <ipython-input-2-aa626427af43> in <module>()
> ----> 1 sage.graphs.graph_plot.DEFAULT_PLOT_OPTIONS['vertex_shape'] = 's'
>
> AttributeError: 'module' object has no attribute 'graph_plot'
> sage: G.plot()
> Launched png viewer for Graphics object consisting of 8 graphics
> primitives
> sage: sage.graphs.graph_plot.DEFAULT_PLOT_OPTIONS['vertex_shape'] = 's'
> sage:
> }}}
>
> I.e. I can set up default options for graph plotting, but only after
> making at least one plot.
>
> Also this might relate to
>
> {{{
> sage.graphs.graph_plot.DEFAULT_SHOW_OPTIONS['vertex_shape'] = 's'
> G.show()
> }}}
>
> --> `TypeError: matplotlib() got an unexpected keyword argument
> 'vertex_shape'`. It seems that default options for **show** does not work
> at all.

New description:

 Documentation for `graph_plot.py` is something like

 {{{
 sage: G = graphs.WheelGraph(15)
 sage: P = G.plot()
 }}}

 . . . some explanation, list of options . . .

 {{{
 sage: sage.graphs.graph_plot.DEFAULT_PLOT_OPTIONS['vertex_shape'] = 's'
  . . .
 }}}

 If the user runs second example, the result is

 {{{
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-2-aa626427af43> in <module>()
 ----> 1 sage.graphs.graph_plot.DEFAULT_PLOT_OPTIONS['vertex_shape'] = 's'

 AttributeError: 'module' object has no attribute 'graph_plot'
 }}}

 That's because `.plot()` runs `import sage.graphs.graph_plot` which is
 needed for `DEFAULT_PLOT_OPTIONS` to work. This patch adds `import` to
 second example.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/19451#comment:6>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to