2

I have a case in which vertex_text is hidden behind the one of the vertices (indicated by the red square in the image below). I have drawn this network using graph_tool's circular layout (minimize_nested_blockmodel_dl).

enter image description here

In the graph_tools docs (https://graph-tool.skewed.de/static/doc/draw.html), I did not find any way to set the zorder for the vertex_text.

I wonder if setting zorders for elements is possible in graph_tool. I would like to know if there is any workaround for this, while keeping the plot and the labels as they are i.e. same size, layout and locations.

If this is useful, for reference, here's are the vertex related parameters I used that went into the draw module:

vertex_text=[list of labels],
vertex_fill_color=[list of colors],
valpha=1,
vertex_size=10,
vertex_pen_width=0,
vertex_text_position=-2,
Issouf
  • 140
  • 12

1 Answers1

1

This can be done using the vorder parameter, which determines the relative order with which nodes and their labels are drawn.

Tiago Peixoto
  • 5,149
  • 2
  • 28
  • 28
  • Thanks for your reply Tiago! About `vertex_order`/`vorder` parameter, how should set it to draw all nodes first and then labels? Some more details would be very helpful. –  Jun 16 '21 at 14:02
  • Or maybe simply point me to one of the examples in the docs where this has been done(?). I will try to figure out of from example/s. (In fact, I learnt `graph_tool` mostly from the excellent examples in the docs.) –  Jun 16 '21 at 14:04
  • 1
    It is not currently possible to draw the nodes and the labels in different order, they are always drawn together. But you can order the nodes in arbitrary ways, and this is what the ``vorder`` parameter does. – Tiago Peixoto Jun 17 '21 at 09:24