Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

An other graph question

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way. For instance, the following code works nicely (until I use Sagemath I was mainly working with PStricks and have not problems with drawing what I expect (if only it could be incorporated completely it would be a great moment)).

Here is my problem : this code works

#---Code---
A= matrix([
[1,1,0,1,0,0,0,0,0],
[1,1,1,0,1,0,0,0,0],
[0,1,1,0,0,1,0,0,0],
[1,0,0,1,1,0,1,0,0],
[0,1,0,1,1,1,0,1,0],
[0,0,1,0,1,1,0,0,1],
[0,0,0,1,0,0,1,1,0],
[0,0,0,0,1,0,1,1,1],
[0,0,0,0,0,1,0,1,1]
])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16,vertex_size=100)

But I do not understand how to set the vertex attributes, he size of the nodes and so on I wonder even why when a loop there are no arrows heads, why the loop is on the node not under. This is for my very strange since I have understood how to change the colors of th arcs. I need trully help (sorry to waste your time). I would also know if one can use an image for attribute of the vertices.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

An other graph question

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way. For instance, the following code works nicely (until I use Sagemath I was mainly working with PStricks and have not problems with drawing what I expect (if only it could be incorporated completely it would be a great moment)).

Here is my problem : this code works

#---Code---
A= matrix([
[1,1,0,1,0,0,0,0,0],
[1,1,1,0,1,0,0,0,0],
[0,1,1,0,0,1,0,0,0],
[1,0,0,1,1,0,1,0,0],
[0,1,0,1,1,1,0,1,0],
[0,0,1,0,1,1,0,0,1],
[0,0,0,1,0,0,1,1,0],
[0,0,0,0,1,0,1,1,1],
[0,0,0,0,0,1,0,1,1]
])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16,vertex_size=100)

But I do not understand how to set the vertex attributes, he size of the nodes and so on I wonder even why when a loop there are no arrows heads, why the loop is on the node not under. This is for my very strange since I have understood how to change the colors of th arcs. I need trully help (sorry to waste your time). I would also know if one can use an image for attribute of the vertices.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

An other Another graph question

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way. For instance, the following code works nicely (until I use Sagemath I was mainly working with PStricks and have not problems with drawing what I expect (if only it could be incorporated completely it would be a great moment)).

Here is my problem : this code works

#---Code---
A= matrix([
[1,1,0,1,0,0,0,0,0],
[1,1,1,0,1,0,0,0,0],
[0,1,1,0,0,1,0,0,0],
[1,0,0,1,1,0,1,0,0],
[0,1,0,1,1,1,0,1,0],
[0,0,1,0,1,1,0,0,1],
[0,0,0,1,0,0,1,1,0],
[0,0,0,0,1,0,1,1,1],
[0,0,0,0,0,1,0,1,1]
])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16,vertex_size=100)

But I do not understand how to set the vertex attributes, he size of the nodes and so on I wonder even why when a loop there are no arrows heads, why the loop is on the node not under. This is for my very strange since I have understood how to change the colors of th arcs. I need trully help (sorry to waste your time). I would also know if one can use an image for attribute of the vertices.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Another graph questionGraph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that that even reading them I cannot find my way. For instance, the following code code works nicely (until I use Sagemath (before using SageMath I was mainly working with PStricks and PStricks with which I have not problems with no problem drawing what I expect (if only it could be be incorporated completely it would be a great moment)).

Here is my problem : problem: this code works

#---Code---
A= A = matrix([
 [1,1,0,1,0,0,0,0,0],
 [1,1,1,0,1,0,0,0,0],
 [0,1,1,0,0,1,0,0,0],
 [1,0,0,1,1,0,1,0,0],
 [0,1,0,1,1,1,0,1,0],
 [0,0,1,0,1,1,0,0,1],
 [0,0,0,1,0,0,1,1,0],
 [0,0,0,0,1,0,1,1,1],
[0,0,0,0,0,1,0,1,1]
])
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16,vertex_size=100)
D.show(figsize=16, vertex_size=100)

image description

But I do not understand how to set the vertex attributes, he attributes, the size of the nodes nodes, and so on on. I wonder even why when a loop there loops have no arrow head, why loops are no arrows heads, why the loop is plotted on the node not under. top of nodes rather than underneath them. This is for my very strange since I have understood understood how to change the colors of th the arcs. I truly need trully help help (sorry to waste your time). I would also know like to know if one can use an image for attribute of the vertices.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way. For instance, the following code works nicely (before way.

Before using SageMath I was mainly working with PStricks with PSTricks with which I have no problem problem drawing what I expect (if expect. If only it could be be incorporated completely completely it would be a great moment)).moment.

Here is my problem: this the code worksbelow works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

#---Code---
A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

image descriptionGrid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder even why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre

Here is what I am able to achieve with pstricks. And the code is astonishingly simple.

image description

For what concerns vertex_attribute I dont know where to put it. I have made many tries. I was very excited in discovering Latex2js because I was expecting to mix html SageCells and it. But right now it is not achieved.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre

Here is what I am able to achieve with pstricks. And the code is astonishingly simple.

image description

For what concerns vertex_attribute I dont know where to put it. I have made many tries.

I was very excited in discovering Latex2js because I was expecting to mix html SageCells and it. But right now it is not achieved.achieved. I am very sorry of this because their exemples are pure killing in comparison to the uncreadibly slow Sagemath @interact.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre

Here is what I am able to achieve with pstricks. And the code is astonishingly simple.

image description

For what concerns vertex_attribute I dont know where to put it. I have made many tries.

I was very excited in discovering Latex2js because I was expecting to mix html SageCells and it. But right now it is not achieved. I am very sorry of this because their exemples are pure killing in comparison to the uncreadibly slow Sagemath @interact.

Added to answer to slelievre

First of all my above code is only 3 lines. I have made many trie to insert vertex_attributes. None works.

Here is what I am able to achieve with pstricks

image description

I can provide the code. As I told you (this is also an answer to the comment to dazedANDconfusedI work now mainly in html withSageCellbecause it's mandatory in those confinment period. The most part of my students (economists) are poorly endown in computers (some works with tablets or even phones). With html embeddedSageCells`I can overcome all those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples are incredible. But all my try are poor. It is not completely achieved and their sand box doesn't work (at least for me). But I thing also that as Sagemathis a pure killing software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase common knowledge. But it is difficult to share it if you must pay for being published or to aquire software.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre

Here is what I am able to achieve with pstricks. And the code is astonishingly simple.

image description

For what concerns vertex_attribute I dont know where to put it. I have made many tries.

I was very excited in discovering Latex2js because I was expecting to mix html SageCells and it. But right now it is not achieved. I am very sorry of this because their exemples are pure killing in comparison to the uncreadibly slow Sagemath @interact.

Added to answer to slelievre

First of all my above code is only 3 lines. I have made many trie to insert vertex_attributes. None works.

Here is what I am able to achieve with pstricks

image description

I can provide the code. As I told you (this is also an answer to the comment to dazedANDconfusedI work now mainly in html withSageCellbecause it's mandatory in those confinment period. The most part of my students (economists) are poorly endown in computers (some works with tablets or even phones). With html embeddedSageCells`I can overcome all those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples are incredible. But all my try are poor. It is not completely achieved and their sand box doesn't work (at least for me). But I thing also that as Sagemathis a pure killing software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase common knowledge. But it is difficult to share it if you must pay for being published or to aquire software.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre

Here is what I am able to achieve with pstricks. And the code is astonishingly simple.

image description

For what concerns vertex_attribute I dont know where to put it. I have made many tries.

I was very excited in discovering Latex2js because I was expecting to mix html SageCells and it. But right now it is not achieved. I am very sorry of this because their exemples are pure killing in comparison to the uncreadibly slow Sagemath @interact.

Added to answer to slelievre

First of all my above code is only 3 lines. I have made many trie to insert vertex_attributes. None works.

Here is what I am able to achieve with pstricks

image description

I can provide the code. As I told you (this is also an answer to the comment to dazedANDconfusedI work now mainly in html withSageCellbecause it's mandatory in those confinment period. The most part of my students (economists) are poorly endown in computers (some works with tablets or even phones). With html embeddedSageCells`I can overcome all those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples are incredible. But all my try are poor. It is not completely achieved and their sand box doesn't work (at least for me). But I thing also that as Sagemathis a pure killing software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase common knowledge. But it is difficult to share it if you must pay for being published or to aquire software.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre

First of all my above code is only 3 lines. I have made many trie tries to insert vertex_attributes. None works.

Here is what I am able to achieve with pstricks

image description

I can provide the code. As I told you (this is also an answer to the comment to dazedANDconfusedI work now mainly in html withSageCellbecause it's mandatory in those confinment period. The most part of my students (economists) are poorly endown in computers (some works with tablets or even phones). With html embeddedSageCells`I can overcome all those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples are incredible. But all my try are poor. It is not completely achieved and their sand box doesn't work (at least for me). But I thing also that as Sagemathis a pure killing software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase common knowledge. But it is difficult to share it if you must pay for being published or to aquire software.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer to slelievre@slelievre's comments

First of all my above code is only 3 lines. lines. I have made many tries to insert vertex_attributes. None works.

Here is what I am able to achieve with pstricks

image descriptionPSTricks:

Graph produced with PSTricks

I can provide the code. As I told you (this is also an answer answer to the comment to dazedANDconfused@dazedANDconfused), I work now mainly mainly in html withwith SageCell because it's mandatory in those confinment period. The most part these lockdown times. Most of my students (economists) are poorly endown (in economics) are poorly endowed in computers (some works work with tablets or even phones). phones). With html embeddedSageCells`I embedded SageCells I can overcome all those those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples exemples are incredible. But all my try trials are poor. It is not completely achieved complete and their sand box sandbox doesn't work (at least for me). But I thing think also that as SagemathSageMath is a pure killing software, software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase increase common knowledge. But it is difficult to share it if you must pay pay for being published or to aquire acquire software.

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer @slelievre's comments

First of all my above code is only 3 lines. I have made many tries to insert vertex_attributes. None works.

Here is what I am able to achieve with PSTricks:

Graph produced with PSTricks

I can provide the code. As I told you (this is also an answer to the comment to @dazedANDconfused), I work now mainly in html with SageCell because it's mandatory in these lockdown times. Most of my students (in economics) are poorly endowed in computers (some work with tablets or even phones). With html embedded SageCells I can overcome all those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples are incredible. But all my trials are poor. It is not complete and their sandbox doesn't work (at least for me). But I think also that as SageMath is a pure killing software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase common knowledge. But it is difficult to share it if you must pay for being published or to acquire software.

The code and images you ask slelievre

Pay attentionmy Latex header is full of PStricks package and I do not remember which are in use for this particular graph (I use also *graphix).

\begin{figure}[H] \begin{center} \begin{pspicture}(-3.2,-3.6)(3.6,3.6) %\psgrid %\pscircle(0,0){3cm} \SpecialCoor \rput(3;0){\rnode{A}{\includegraphics[scale=.25]{Avat0.png}$_a$}} \rput(3;72){\rnode{B}{\includegraphics[scale=.25]{Avat1.png}$_b$}} \rput(3;142){\rnode{C}{\includegraphics[scale=.25]{Avat2.png}$_c$}} \rput(3;214){\rnode{D}{\includegraphics[scale=.25]{Avat5.png}$_d$}} \rput(3;286){\rnode{E}{\includegraphics[scale=.25]{Avat4.png}$_e$}} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{->}{B}{A} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{C}{A} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{D}{A} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{A}{E} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{C}{B} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{D}{B} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{->}{B}{E} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{D}{C} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{E}{D} \ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{C}{E} \NormalCoor \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{AA}{\tiny2/\textcolor{venetianred}3} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{BB}{\tiny\textcolor{venetianred}{3}/2} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{CC}{\tiny\textcolor{venetianred}{3}/2} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{DD}{\tiny2/\textcolor{venetianred}{3}} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{EE}{\tiny\textcolor{venetianred}{4}/1} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{FF}{\tiny\textcolor{venetianred}{4}/1} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{GG}{\tiny\textcolor{venetianred}{3}/2} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{HH}{\tiny\textcolor{venetianred}{3}/2} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{II}{\tiny1/\textcolor{venetianred}{4}} \cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{KK}{\tiny2/\textcolor{venetianred}{3}} \end{pspicture} \end{center} \caption{\textsc{Scores dans les confrontations deux à deux}}\label{condorcetcomp} \end{figure}

image description

<code>image description</code>

image description

image description

image description

Good work but I think it will be simpler to extend theshow command to pstricks. In that case Sagemath woul become a pure wonder!

Graph plot: vertex attributes, node size, arrow head for loops, why are loops on nodes

Sorry, some of you think that I do not read the docs but the truth is that even reading them I cannot find my way.

Before using SageMath I was mainly working with PSTricks with which I have no problem drawing what I expect. If only it could be incorporated completely it would be a great moment.

Here is my problem: the code below works but I do not understand how to set the vertex attributes, the size of nodes, and so on.

A = matrix([
    [1,1,0,1,0,0,0,0,0],
    [1,1,1,0,1,0,0,0,0],
    [0,1,1,0,0,1,0,0,0],
    [1,0,0,1,1,0,1,0,0],
    [0,1,0,1,1,1,0,1,0],
    [0,0,1,0,1,1,0,0,1],
    [0,0,0,1,0,0,1,1,0],
    [0,0,0,0,1,0,1,1,1],
    [0,0,0,0,0,1,0,1,1]])

D = DiGraph(A, format='adjacency_matrix')
D.show(figsize=16, vertex_size=100)

Grid graph with unsatisfactory loops

But I do not understand how to set the vertex attributes, the size of the nodes, and so on. I even wonder why loops have no arrow head, why loops are plotted on top of nodes rather than underneath them. This is for my very strange since I have understood how to change the colors of the arcs. I truly need help (sorry to waste your time). I would also like to know if one can use images as vertex attributes.

vertex_attrs={'label':['1','2','3','4','5','6','7','8','9',]}

Added to answer @slelievre's comments

First of all my above code is only 3 lines. I have made many tries to insert vertex_attributes. None works.

Here is what I am able to achieve with PSTricks:

Graph produced with PSTricks

I can provide the code. As I told you (this is also an answer to the comment to @dazedANDconfused), I work now mainly in html with SageCell because it's mandatory in these lockdown times. Most of my students (in economics) are poorly endowed in computers (some work with tablets or even phones). With html embedded SageCells I can overcome all those difficulties since computation are not realized in situ.

I was delighted in discovering Latex2js since their exemples are incredible. But all my trials are poor. It is not complete and their sandbox doesn't work (at least for me). But I think also that as SageMath is a pure killing software, it must be raised to that level.

Science is a pure public good. We are paid by government to increase common knowledge. But it is difficult to share it if you must pay for being published or to acquire software.

The PSTricks code and images you ask node images as requested by slelievre

Pay attentionmy Latex header is full

Note: my LaTeX preamble uses lots of PStricks package packages and I do not not remember which are in use used for this particular graph (I use also *graphix).

\begin{figure}[H]
\begin{center}
\begin{pspicture}(-3.2,-3.6)(3.6,3.6)
%\psgrid
%\pscircle(0,0){3cm}
\SpecialCoor
\rput(3;0){\rnode{A}{\includegraphics[scale=.25]{Avat0.png}$_a$}}
\rput(3;72){\rnode{B}{\includegraphics[scale=.25]{Avat1.png}$_b$}}
\rput(3;142){\rnode{C}{\includegraphics[scale=.25]{Avat2.png}$_c$}}
\rput(3;214){\rnode{D}{\includegraphics[scale=.25]{Avat5.png}$_d$}}
\rput(3;286){\rnode{E}{\includegraphics[scale=.25]{Avat4.png}$_e$}}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{->}{B}{A}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{C}{A}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{D}{A}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{A}{E}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{C}{B}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{D}{B}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{->}{B}{E}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{D}{C}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{E}{D}
\ncarc[nodesep=3pt,linecolor=venetianred,linewidth=1.2pt]{<-}{C}{E}
\NormalCoor
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{AA}{\tiny2/\textcolor{venetianred}3}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{BB}{\tiny\textcolor{venetianred}{3}/2}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{CC}{\tiny\textcolor{venetianred}{3}/2}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{DD}{\tiny2/\textcolor{venetianred}{3}}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{EE}{\tiny\textcolor{venetianred}{4}/1}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{FF}{\tiny\textcolor{venetianred}{4}/1}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{GG}{\tiny\textcolor{venetianred}{3}/2}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{HH}{\tiny\textcolor{venetianred}{3}/2}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{II}{\tiny1/\textcolor{venetianred}{4}}
\cnodeputlinestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true{KK}{\tiny2/\textcolor{venetianred}{3}}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](2.2,1.4){AA}{\tiny2/\textcolor{venetianred}3}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](0.4,1.2){BB}{\tiny\textcolor{venetianred}{3}/2}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](-1,-1){CC}{\tiny\textcolor{venetianred}{3}/2}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](2,-1.6){DD}{\tiny2/\textcolor{venetianred}{3}}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](-.5,2.6){EE}{\tiny\textcolor{venetianred}{4}/1}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](-1.6,-.2){FF}{\tiny\textcolor{venetianred}{4}/1}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](1.,-1.4){GG}{\tiny\textcolor{venetianred}{3}/2}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](-2.6,0){HH}{\tiny\textcolor{venetianred}{3}/2}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](.2,-1.6){II}{\tiny1/\textcolor{venetianred}{4}}
\cnodeput[linestyle=none,fillstyle=solid, fillcolor=white, shadow=true,blur=true](-1,-2.4){KK}{\tiny2/\textcolor{venetianred}{3}}
\end{pspicture}
\end{center}
\caption{\textsc{Scores dans les confrontations deux à deux}}\label{condorcetcomp}
\end{figure}

image description

<code>image description</code>

image description

image description

image description\end{figure}

Node images: a · b · c · d · e.

Good work luck working on that but I think it will be simpler to extend theshow the show command to pstricks. In that case Sagemath woul become use PSTricks. That would make SageMath a pure wonder!