修改图形的边/顶点边框粗细的Sage语法是什么?

问题描述 投票:1回答:1

Sage非常出色,尤其是图论。但实际上我找不到如何改变边缘或顶点边界厚度的例子。

我没有成功读过this documentation

我正在使用这个:

import sage.graphs.graph_plot
G = graphs.Grid2dGraph(4,4)
P = G.graphplot(vertex_labels=False, vertex_size=700, graph_border=False, edge_thickness=10)
P.show()

......但是Sage仍然不承认edge_thickness选项。

提前致谢

python sage
1个回答
1
投票

由于Sage 7.3,所请求的功能可以使用

如果您运行的是旧版Sage,请考虑升级。每个新版本都带来了改进和错误修复。

使用最新版本的Sage之一:

sage: version()
'SageMath version 8.2.rc2, Release Date: 2018-04-10'

edge_thickness参数有明显的区别。

没有指定edge_thickness

sage: import sage.graphs.graph_plot
sage: G = graphs.Grid2dGraph(4,4)
sage: P = G.graphplot(vertex_labels=False, vertex_size=700, graph_border=False)
sage: P.show()
Launched png viewer for Graphics object consisting of 25 graphics primitives

Grid graph with edge_thickness=1

指定edge_thickness=10

sage: P = G.graphplot(vertex_labels=False, vertex_size=700, graph_border=False, edge_thickness=10)
sage: P.show()
Launched png viewer for Graphics object consisting of 25 graphics primitives

Grid graph with edge_thickness=10

指定edge_thickness=1(与默认值相同):

sage: P = G.graphplot(vertex_labels=False, vertex_size=700, graph_border=False, edge_thickness=1)
sage: P.show()
Launched png viewer for Graphics object consisting of 25 graphics primitives

Grid graph with edge_thickness=1

© www.soinside.com 2019 - 2024. All rights reserved.