pong wrote:
> I am using SAGE 4.1.2 notebook on firefox on a Mac.
> 
> k=graphs.CompleteGraph(6)
> show(k)
> 
> displays K_6 but the vertices got truncated. I don't have this problem
> on a linux machine running SAGE 4.1.1 notebook on firefox.
> 
> Any help?
> I would like to include the pic but I don't see how on using this
> discussion group.

I think this is because the graph plotting code sets the min/max x/y 
positions to the coordinates of the vertices, without allowing for the 
radii of the circles representing the vertices.  If the graph_border 
option is given, then a border is added to the picture and the 
xmin/xmax, ymin/ymax parameters are expanded.

To fix this, try replacing the line:

         G.set_axes_range(self.xmin, self.xmax, self.ymin, self.ymax)

(line 767 in graphs/graph_plot.py)

with the following two lines:

         v_radius = sqrt(self._options['vertex_size']/pi)*1.5 # 
vertex_size is the area of the vertex circle, then pad a bit
         G.set_axes_range(self.xmin-v_radius, self.xmax+v_radius, 
self.ymin-v_radius, self.ymax+v_radius)

to allow space for the radii of the vertices.  I can't test this right 
now because of problems with my Sage installation.

Thanks,

Jason


-- 
Jason Grout


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to