---------- Forwarded message ---------- From: Kazuo Thow <kazuo.t...@gmail.com> Date: Fri, Nov 20, 2009 at 2:17 PM Subject: Re: [sage-support] Problems with Graphs To: William Stein <wst...@gmail.com> Cc: Kevin Clark <kevinclark...@gmail.com>
Michel, There's an option in the plot() function, edge_labels, which is set to False by default. If you use > G=DiGraph({0:{2:'3*x^2'}, 1:{0:'3/x'}, 2:{1:'6*x^2'}}) > G.plot(edge_labels=True) then your graph should display properly with all its edge labels. You can also change the colors of the edges to make the labels stand out better against their background: > G.plot(edge_labels=True, edge_colors='#dddddd') And of course, '#dddddd' can be replaced by any hexadecimal code you want. You can see more options like these by typing G.plot?. As for the vertex labels being cut off, setting graph_border=True will give enough padding around the border of the image. Kevin Clark recently implemented a better fix for this issue, but I don't know if it's included in most recent release. (It's definitely not included in the online version at sagenb.org.) Hope that helps, Kazuo On Fri, Nov 20, 2009 at 12:51 PM, William Stein <wst...@gmail.com> wrote: > > One of you guys could answer this poor user's support request... > > > ---------- Forwarded message ---------- > From: Michel <vdbe...@gmail.com> > Date: Fri, Nov 20, 2009 at 12:48 PM > Subject: [sage-support] Problems with Graphs > To: sage-support <sage-support@googlegroups.com> > > > I am trying to use the Graph functionality in sage but it does not > quite work. > > I do > > G=DiGraph({0: {2: '3*x^2'}, 1: {0: '3/x'}, 2: {1: '6*x^2'}}) > G.show() > > A pgn viewer pops up showing the graph indeed. However: > > (a) The vertex labels are cropped. > (b) No edge labels are shown. > > Am I doing something wrong? > > This Sage 4.2.1. Freshly compiled from source on Ubuntu 9.04. > > -- > To post to this group, send email to sage-support@googlegroups.com > To unsubscribe from this group, send email to > sage-support-unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-support > URL: http://www.sagemath.org > > > -- > William Stein > Associate Professor of Mathematics > University of Washington > http://wstein.org -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org