ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 15 Apr 2020 09:33:36 +0200Changing display labels of nodes on a graphhttps://ask.sagemath.org/question/50764/changing-display-labels-of-nodes-on-a-graph/ Hi,
I have created a graph which is in fact a tree. Each node has a label that I gave at creation time. Now, when I plot the graph for each node this "internal" label is displayed. Is it possible to have different display labels than this "internal" label?
ThanksoldaniWed, 15 Apr 2020 09:33:36 +0200https://ask.sagemath.org/question/50764/How to draw the following graph in sagemath?https://ask.sagemath.org/question/48245/how-to-draw-the-following-graph-in-sagemath/ How to draw the following graph in sagemath?
I am uploading the image here:
https://imgur.com/Q3sUXn8
I know how to draw a graph but I am finding it difficult to draw the graph in exactly the same way as shown in the picture.
Is it possible to do this?
I will be very grateful if someone could kindly help me outCaptchaWed, 09 Oct 2019 14:27:58 +0200https://ask.sagemath.org/question/48245/Is there a way to draw a graph using a specific embedding?https://ask.sagemath.org/question/35533/is-there-a-way-to-draw-a-graph-using-a-specific-embedding/ It is possible to set the embedding of a graph ([set_embedding](http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/generic_graph.html#sage.graphs.generic_graph.GenericGraph.set_embedding)), but `plot()` doesn't seem to respect it. Is there a way to plot the graph using the specified embedding?
Here is an example showing that `faces()` respects the embedding, although plotting each gives the same output:
sage: G = Graph({0:[1,2,3], 2:[3], 3:[4]})
sage: G.faces()
[[(0, 1), (1, 0), (0, 2), (2, 3), (3, 4), (4, 3), (3, 0)],
[(2, 0), (0, 3), (3, 2)]]
sage: G.set_embedding({0:[2,1,3], 1:[0], 2:[0,3], 3:[0,2,4], 4:[3]})
sage: G.faces()
[[(0, 1), (1, 0), (0, 3), (3, 2), (2, 0)],
[(3, 0), (0, 2), (2, 3), (3, 4), (4, 3)]]jaebondFri, 11 Nov 2016 22:24:18 +0100https://ask.sagemath.org/question/35533/