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, 11 Jul 2018 09:29:07 +0200Changing the vertex shape for combinatorial graphshttps://ask.sagemath.org/question/8853/changing-the-vertex-shape-for-combinatorial-graphs/Hi all:
Given a combinatorial graph (the nodes and edges type) $g$, what are the valid `vertex_shape` options for `g.plot()`? I can't find them in the Sage reference manual. I want to make square vertices.
Thanks.Wed, 04 Apr 2012 19:14:20 +0200https://ask.sagemath.org/question/8853/changing-the-vertex-shape-for-combinatorial-graphs/Answer by fidbc for <p>Hi all:</p>
<p>Given a combinatorial graph (the nodes and edges type) $g$, what are the valid <code>vertex_shape</code> options for <code>g.plot()</code>? I can't find them in the Sage reference manual. I want to make square vertices.</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/8853/changing-the-vertex-shape-for-combinatorial-graphs/?answer=13423#post-id-13423Hi,
Sage uses matplotlib to plot graphs, and valid vertex shapes seem to be valid matplotlib markers, you chan check the matplotlib [documentation](http://x0.no/3pcb) for some other valid markers.
If you want squares, then you can try, say
sage: g=graphs.PetersenGraph();gp=g.graphplot()
sage: gp.set_vertices(vertex_shape='s');gp.plot()
Apparently changing vertex shapes is still not available for Multi-edged Digraphs though.
Wed, 04 Apr 2012 23:28:33 +0200https://ask.sagemath.org/question/8853/changing-the-vertex-shape-for-combinatorial-graphs/?answer=13423#post-id-13423Comment by slelievre for <p>Hi,</p>
<p>Sage uses matplotlib to plot graphs, and valid vertex shapes seem to be valid matplotlib markers, you chan check the matplotlib <a href="http://x0.no/3pcb">documentation</a> for some other valid markers.</p>
<p>If you want squares, then you can try, say</p>
<pre><code>sage: g=graphs.PetersenGraph();gp=g.graphplot()
sage: gp.set_vertices(vertex_shape='s');gp.plot()
</code></pre>
<p>Apparently changing vertex shapes is still not available for Multi-edged Digraphs though.</p>
https://ask.sagemath.org/question/8853/changing-the-vertex-shape-for-combinatorial-graphs/?comment=42905#post-id-42905See also:
- [Matplotlib documentation page for marker shapes](https://matplotlib.org/api/markers_api.html?highlight=shape)Wed, 11 Jul 2018 09:29:07 +0200https://ask.sagemath.org/question/8853/changing-the-vertex-shape-for-combinatorial-graphs/?comment=42905#post-id-42905