8

I want to illustrate the network graph of a person. The idea is that the network consists of 3 types of people, therefore there are 3 kinds of color and face. The persona is one of the types, so its circle is largest and in the center. The sizes of the circles represent the importance of that person to the persona. So the first level circles is 50% smaller than the center circle, and the second level is 50% smaller than the first level circles.

Somehow I don't feel the graph is well-proportioned. Maybe the center circle is too large? Would moving the notes further help?

Overall, is there any thing that you feel like can be improved as well?


Here is the SVG file

9
  • 1
    This has already partly been covered in the answers below. Too many different stroke weights is one of the big problems imo. – curious May 13 at 17:18
  • 12
    Please be aware that the XKCD characters are NOT free to use. They are licensed under a CC BY-NC 2.5 licence (creativecommons.org/licenses/by-nc/2.5). This means you MUST credit the author (XKCD/Randall Munroe) and you CANNOT use it for any commercial stuff. – PieBie May 13 at 18:36
  • 2
    Also be aware that this means no posting on stackexhange since srackexhange changes kicense of your images – joojaa May 14 at 4:38
  • @PieBie just a thought: if someone in the comment already credit the author, does that mean that I don't need to credit again? FWIW, I open a relevant question on Law SE if anyone interested: Does credit need to be immediately after using the material? – Ooker May 15 at 16:35
  • 1
    @Ooker You are completely free to do or not do whatever you want of course. Where, when and how you credit is completely up to you. The consequences of those decisions are similarly your own. – PieBie May 24 at 11:57
6

Graph balancing is hard, and any tips that you get for the above graph might not apply anymore if you modify some connections.

There are dedicated tools for this task, e.g. Graphviz.

You could give ids to your nodes: enter image description here

and simply list every connection:

graph G {
    1 -- 2
    1 -- 4
    2 -- 3
    2 -- 5
    2 -- 6
    3 -- 8
    4 -- 5
    4 -- 11
    5 -- 6
    5 -- 9
    6 -- 7
    6 -- 9
    6 -- 10
    6 -- 12
    7 -- 8
    8 -- 10
    8 -- 13
    9 -- 11
    9 -- 12
    10 -- 13
    11 -- 12
    12 -- 13
}

You can also specify the size, the labels and the colors. Note that the positions are not specified anywhere:

graph G {
    // Graph layout
    overlap=scalexy;
    sep="+0.1";

    // Node sizes
    node[shape=circle];
    node[width=1.5];
    6[fontcolor="dodgerblue4"];
    
    node[width=0.8];
    1;
    2[fontcolor="darkseagreen4"];
    5[fontcolor="dodgerblue4"];
    9[fontcolor="dodgerblue4"];
    10[fontcolor="dodgerblue4"];
    12[fontcolor="darkseagreen4"];
    13
    
    node[width=0.2];
    
    // Connections
    1 -- 2
    1 -- 4
    2 -- 3
    2 -- 5
    2 -- 6
    3 -- 8
    4 -- 5
    4 -- 11
    5 -- 6
    5 -- 9
    6 -- 7
    6 -- 9
    6 -- 10
    6 -- 12
    7 -- 8
    8 -- 10
    8 -- 13
    9 -- 11
    9 -- 12
    10 -- 13
    11 -- 12
    12 -- 13

    // Colors
    4[fontcolor="darkseagreen4"];
    8[fontcolor="darkseagreen4"];
    1[fontcolor="gold2"];
    3[fontcolor="gold2"];
    7[fontcolor="gold2"];
    11[fontcolor="gold2"];
    13[fontcolor="gold2"];
}

There are different balancing algorithms. neato gives results that are similar to your example:

enter image description here

It would also work fine with hundreds of nodes. You can try it with this online-editor, and play with the sizes and connections.

You can also insert images inside nodes and output png or svg files.

7
  • 1
    That's so great. Many thanks. I wonder why node 3, 4, 7 and 11 are not circles but ovals? – Ooker May 14 at 16:05
  • 2
    @Ooker if memory servers, Graphviz's default node shape is an oval, not a circle, what follows is just automatic size adjustment. Eric did not give those nodes a fixed size in his script. Would probably be easier to just throw node[shape=circle] near the top of the script. From documentation, we find that Normally, the size of a node is determined by smallest width and height needed to contain its label and image, if any, with a margin specified by the margin attribute. All in all, Graphviz is a powerful if unwieldy tool. – Jan Dorniak May 15 at 14:04
  • @JanDorniak: Makes sense. Thanks a lot! I've updated the link. – Eric Duminil May 15 at 15:38
  • @Ooker: I've updated the code. Circles are now circles. :D – Eric Duminil May 15 at 15:38
  • 1
    @EricDuminil I suggested an edit, seems like you forgot to update the Graphviz preview. – Jan Dorniak May 15 at 15:43
12

It's difficult to answer questions like this because they are opinion based. However I am prepared to give you an answer with the proviso that this is just my personal opinion. Feel free to completely disregard it.

I think the diagram looks quite complex, and there's a lack of contrast which makes the diagram quite hard to read. I don't think it's "unbalanced". Instead of relying on all those coloured strokes it might be better to simplify the diagram by using colour fills instead.

Something like this to give you a very rough idea

enter image description here

6
  • thanks. But since this graph is to pair with other sketches, which the characters are in strokes and in black. I put the graph besides it and it feels hard to follow – Ooker May 13 at 17:09
  • 1
    @Ooker You could totally draw inspiration from Billy's answer and use black outline characters in my opinion. Just having an area of color in the background will help I think and you might be able to adjust the colors for contrast. – curious May 13 at 17:12
  • @curious I don't understand what you mean. Do you mean that using Billy's idea is totally fine in next to the Venn diagram? Can you give an example? – Ooker May 13 at 17:17
  • 2
    I'm saying you could probably adapt what Billy is showing and swap the white characters for black ones. My worry would be it won't be as contrasted but lightening the colors a bit might do the trick. – curious May 13 at 17:21
  • @Ooker - this is only a very rough suggestion. Feel free to adapt it or tweak it as you think best. I also like Scotts suggestion. There are many ways to approach this. – Billy Kerr May 13 at 17:50
6

To me...

The issue is the seemingly random connections.

Merely aligning things and being a bit more methodical about how the connections relate, in terms of the location of the circles, goes a long way to a more solidified impression. Using a relatively symmetrical outer shape will convey more balance.

enter image description here

Note I've also ensured all the strokes are the same weight even though the circles are reduced in size. The uniform stroke weights also aide in overall balance.

In terms of Gestalt... using unified stroke weights makes it appear that all connections are the same in strength and the size indicates varied importance.

To fit the internal icons, that may mean you need to enlarge the small circles a bit.

5
  • Why do the strokes need to be in the same weight? How about putting the characters inside? – Ooker May 13 at 17:11
  • 2
    @Ooker Using the same weight on every circle helps to balance them. Thin lines make them seem like they are far in space and the thicker weight also adds contrast like Billy did. Personally, I also tend to think it's a mistake and someone forgot to uncheck the scale strokes option when I see two shapes where the smaller one has a slightly thinner outline. – curious May 13 at 17:16
  • 2
    .. what @curious wrote :) I didn't put the icons merely because I didn't want to take the time to draw them. I felt that was unnecessary with respect to balancing things. – Scott May 13 at 17:26
  • I like the overall shape now. I was thinking to write an answer with a shape like rectangle overall, but I thought it might result in a bad idea. This is even better. – Vikas May 13 at 18:44
  • 1
    In my opinion, using an actual rectangle is a bit too uniform and loses the idea of more randomness in the connections. I tried it.. it didn't work for me in terms of the aesthetics. – Scott May 14 at 5:20
5
  1. Break the unfinished regular hexagon. It's so near complete that it looks disturbing.

  2. The biggest circle presents somehow more remarkable member than the others. Let him be the center of the mass - In other words: if there's a rotation axis in the midpoint of the biggest circle the torques caused by the weights of all other items (including the lines) would cancel each other. I guess it doesn't change the meaning of the graph.

I moved a couple of items to satisfy requirement 1. and approximately also requirement 2.

enter image description here

1
  • What if we make overall shape as a rectangle? Wouldn't it be better? – Vikas May 14 at 3:31
2

This is my final result, using Graphviz. Removing the circle seems to be neater.

Alternative, just simply you can get rid the characters altogether and just fill the color:

enter image description here

3
  • Well done! It looks great. Would you agree to share the corresponding code, please? – Eric Duminil May 16 at 13:12
  • I actually use your code, download the SVG file, add the characters, remove the circles and add outside edges to make the graph looks incomplete – Ooker May 16 at 15:08
  • Oh, okay. I guess it should be possible to do all this directly with graphviz, including adding invisible nodes. – Eric Duminil May 16 at 15:27
2

I don't think anyone has posted links to theoretical algorithms, so I will:

Force-directed graph drawing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.