Ask Your Question
2

graph vertex labelling

asked 2018-07-10 19:11:12 +0100

deinst gravatar image

updated 2018-07-10 20:41:45 +0100

I have a graph (poset actually) that has a rational function labelling each vertex. I would like to show just the edges and the vertex labels. If I try to set vertex_shape='None' I get a crash deep in matplotlib. If I try anything else I get the marker symbol printed over the label. For example

  P = RootSystem(['A',3]).root_poset()
  P.show(vertex_color='white')

Will show the graph with circles over the labels. If I shrink the labels, then the edges cover the labels. If I do

  P = RootSystem(['A',3]).root_poset()
  P.show(vertex_color='white', vertex_shape='None')

there is a strange crash.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-07-11 09:36:01 +0100

slelievre gravatar image

Trying the various marker shapes described in the

it seems that vertex_shape='_' and vertex_shape='|' work well:

sage: P.show(vertex_color='white', vertex_shape='_')
sage: P.show(vertex_color='white', vertex_shape='|')

in that (for me at least) they result in what could be expected from vertex_shape='None'.

edit flag offensive delete link more

Comments

Thanks. I had looked at the matplotlib page, but had not expected that '_' or '|' would do what I wanted.

deinst gravatar imagedeinst ( 2018-07-11 18:51:45 +0100 )edit
1

answered 2018-07-11 09:28:24 +0100

FrédéricC gravatar image

Did you try "view(P)" for the latex display ? This may require installing graphviz and dot2tex.

edit flag offensive delete link more

Comments

For me, without graphviz or dot2tex,

sage: is_package_installed('graphviz')
False
sage: is_package_installed('dot2tex')
False

the following worked,

sage: P = RootSystem(['A',3]).root_poset()
sage: view(P)

resulting in a nice view with the "alpha" letters typeset in LaTeX.

The layout was not the one you would expect for a poset though.

slelievre gravatar imageslelievre ( 2018-07-11 11:54:58 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-07-10 19:11:12 +0100

Seen: 1,321 times

Last updated: Jul 11 '18