Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph plot default options before first call to plot() fail #19451

Closed
jm58660 mannequin opened this issue Oct 22, 2015 · 10 comments
Closed

Graph plot default options before first call to plot() fail #19451

jm58660 mannequin opened this issue Oct 22, 2015 · 10 comments

Comments

@jm58660
Copy link
Mannequin

jm58660 mannequin commented Oct 22, 2015

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.

CC: @nathanncohen

Component: documentation

Author: Jori Mäntysalo

Branch/Commit: 2ccbf2b

Reviewer: Nathann Cohen

Issue created by migration from https://trac.sagemath.org/ticket/19451

@jm58660 jm58660 mannequin added this to the sage-6.10 milestone Oct 22, 2015
@jm58660 jm58660 mannequin added c: group theory labels Oct 22, 2015
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Oct 22, 2015

comment:1

So the bug is that you have to import the module first? The reason why the second call works is that .plot() loads it for you.

Nathann

@jm58660

This comment has been minimized.

@jm58660 jm58660 mannequin added c: graph theory and removed c: group theory labels Oct 22, 2015
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Oct 22, 2015

comment:3

Hmmmmm.. I think that the DEFAULT_SHOW_OPTIONS dictionary actually gives its data to GraphPlot.show, and not to GenericGraph.show.

Nathann

@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Feb 2, 2016

@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Feb 2, 2016

Commit: 2ccbf2b

@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Feb 2, 2016

comment:5

I suggest adding an import-line before first example of using DEFAULT_SHOW_OPTIONS.


New commits:

2ccbf2bAdd an import-line to example.

@jm58660 jm58660 mannequin added c: documentation and removed c: graph theory labels Feb 2, 2016
@jm58660 jm58660 mannequin modified the milestones: sage-6.10, sage-7.1 Feb 2, 2016
@jm58660

This comment has been minimized.

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Feb 2, 2016

Author: Jori Mäntysalo

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Feb 2, 2016

Reviewer: Nathann Cohen

@vbraun
Copy link
Member

vbraun commented Feb 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant