3

I am working in SageMathCloud and have the following code:

import networkx
import matplotlib.pyplot as plt

test5 = networkx.Graph()
example = graphs.BuckyBall
test5.add_node(example)
networkx.draw(test5)
plt.show()

and from what I read, should display a graph with a single vertex that has a graph inside of it, like this picture from this article.this picture However, all it shows is a single vertex with nothing inside of it as shown: idk Is there any way to display the graph to look like the 1st picture, where the graphs (as vertices) are shown?

4
  • Since you're using networkx I'm not sure if they support that. Sage itself does support different labels for the graphs, but you might have to hack the code to get it to display this kind of thing - which could be worthwhile.
    – kcrisman
    Sep 17, 2016 at 21:02
  • 1
    You should try asking on the Networkx mailing list or in some sort of Networkx forum. Also, try writing to the author of math.toronto.edu/~rafi/gofg.html and ask him how he made that plot. He might have exported some data to an external tool like graphviz, and made the plot there. Sep 19, 2016 at 16:24
  • 1
    I asked Kasra Rafi. He and Jing Tao made the graph of graphs in TikZ from pictures of small graphs (inside the nodes) output by Mathematica. Sep 1, 2017 at 18:16
  • Note: a similar question was asked on Ask Sage. Sep 1, 2017 at 18:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.