[sage-support] drawing graphs

2009-06-15 Thread Dominique Manchon

Hello!

I'm a newcomer into Sage and Python. When I want to draw some
graphical
representation of graphs I get problems : the vertices are partially
cut-off. They almost disappear when the graph looks like a vertical
ladder. For example:

arbre1={0:[1],1:[]}
arbre2={0:[1,2],1:[],2:[]}
A1=Graph(arbre1)
AA1=A1.plot(vertex_size=120, layout=tree,
tree_orientation=up,tree_root=0)
A2=Graph(arbre2)
AA2=A2.plot(vertex_size=120, layout=tree,
tree_orientation=up,tree_root=0)
AA1.show(figsize=[2,2]);AA2.show(figsize=[2,2])

How can I cure this?

Another related question : which values are allowed for figsize[-,-]?
Very
often I would like quite tiny drawings (hence small values) but then I
get
an error message. For example the same as above with figsize=[1,1]
returns
the message below. Why?

Thanks in advance for the help.

Dominique Manchon

libpng error: Image width or height is zero in IHDR
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/sage/sagenb/sage_notebook/worksheets/manchon/4/code/
24.py,
line 13, in module
AA1.show(figsize=[_sage_const_1 ,_sage_const_1
]);AA2.show(figsize=[_sage_const_1 ,_sage_const_1 ])
  File
/home/sage/sage_install/sage/local/lib/python2.5/site-packages/
Jinja-1.2-py2.5-linux-x86_64.egg/,
line 1, in module

  File
/home/sage/sage_install/sage/local/lib/python2.5/site-packages/sage/
plot/plot.py,
line 1291, in show
hgridlinesstyle=hgridlinesstyle)
  File
/home/sage/sage_install/sage/local/lib/python2.5/site-packages/sage/
plot/plot.py,
line 1616, in save
canvas.print_figure(filename, dpi=dpi)
  File
/home/sage/sage_install/sage/local/lib/python2.5/site-packages/
matplotlib/backend_bases.py,
line 1453, in print_figure
**kwargs)
  File
/home/sage/sage_install/sage/local/lib/python2.5/site-packages/
matplotlib/backends/backend_agg.py,
line 334, in print_png
filename_or_obj, self.figure.dpi)
RuntimeError: Error building image

--~--~-~--~~~---~--~~
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
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Drawing graphs with color coded edge labels

2008-05-17 Thread Nikos Apostolakis

Hello,

I have a directed graph with edges labeled using two different labels.
Is it possible to draw this graph (2D or 3D) using two different colors
to signify the different labels, eg red for one label and green for the 
other?  I seem to remember seeing such an exmple somewhere but I wasn't 
able to find it again.

And a more general question.  I generated this graph as follows:  I have
a group G with two generators acting on a finite set X.  I use GAP to get 
the orbits of each generator and then I write a smal script to produce 
a SAGE DiGraph from these data: vertices correspond to elements of X and
edges correspond to the generators of G.  Is there a more
straightforward way to do this in SAGE, I mean starting from a group
action to get a digraph? 

TIA


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---