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.Fri, 09 Jan 2015 13:05:52 +0100Graph edge label: formatting possibilitieshttps://ask.sagemath.org/question/25448/graph-edge-label-formatting-possibilities/I have a graph with like this and would like to format ( e.g. color ) the edge labels more individual. Is it possible for example to make from 'a|b' the 'a' red and 'b' blue? Also different font types ( bold, italic ) etc would be interesting.
G = Graph(multiedges=True)
G.add_edges( [(0,1,'a|b'),(1,2,'c|d'),(2,3,'e|f'),(3,4,'g|h'),(4,0,'i|j')] )
H = G.plot(edge_labels=True, graph_border=True)
H.show()
When I remember correctly, there is (limited) support for TeX-formatting, could this be used somehow to achieve the formatting?herbFri, 09 Jan 2015 13:05:52 +0100https://ask.sagemath.org/question/25448/Plot display problems when changing IP address?https://ask.sagemath.org/question/8464/plot-display-problems-when-changing-ip-address/The following senario has happened to me a couple of times when using Sage to demonstrate things in a classroom.
1. I'm working on a worksheet containing plots of simple functions for a calculus class in my office. The worksheet is on a notebook server somewhere (on campus, at sagenb.org, etc..).
2. I close my laptop, walk downstairs to class, open my laptop and plug into the projector. The laptop is now on a different wireless network, but still connects to the sage notebook server just fine. I get a red "searching for sage server" notice for just a second and then it disappears and the worksheet behaves like normal.
3. I'm half way through class, showing plots of this and that, and I decide that I want to change the bounds on one of my plots.
Say I have
f(x) = 3*x^4+4*x^3-6*x^2
plot( f, (x,-2,3) )
and I want to zoom in and look at
plot( f, (x, -1, 1) )
and a new plot shows up, but it's not quite right. Sometimes I've had the experience that the plot doesn't change at all, I get the same plot as before (i.e. after editing the cell and hitting shift+enter again). Sometimes I get a new plot, but it's not correct. For example, this happened today and I got a new plot which was on the interval (-2, 1) not (-1, 1). I keep editing the cell and trying to re-evaluate the plot and get just continue to get incorrect domains or unchanged plots.
It seems like something is going on with cached images, or old images being re-displayed.
I finally figured out that I can solve the problem by cutting and pasting the code into a new cell, changing the name of the function to something different like h(x), and evaluating the cell.
Any thoughts on why this is happening or how I can prevent it from happening in the middle of class? Do I need to completely log out / log in to the server every time my IP address changes? Or maybe this problem is completely unrelated to the network change.benjaminfjonesThu, 10 Nov 2011 18:21:22 +0100https://ask.sagemath.org/question/8464/Best way to plot graphhttps://ask.sagemath.org/question/8226/best-way-to-plot-graph/Hello!
Could you pleas advise me the best way to plot graph with cycles and make it looks like tree? Here is the sample picture of result I'd like to have:
![image description](http://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Artificial_neural_network.svg/350px-Artificial_neural_network.svg.png)
Plot on this pictures have 'layers', is there any chance to get something like this in Sage? I tried this:
t = DiGraph()
t.add_edge((0,1))
t.add_edge((0,2))
t.add_edge((0,3))
t.add_edge((0,4))
t.add_edge((4,9))
t.add_edge((3,9))
t.add_edge((2,9))
t.add_edge((1,9))
t.plot()
but the [result](http://img17.imageshack.us/i/sage0.png/) is far from desired.
Thanks.
EugeneThu, 14 Jul 2011 17:23:01 +0200https://ask.sagemath.org/question/8226/