Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.8K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Plot a network from a weighted adjacency matrix

2 Replies

Thank you very much for your answer!

I have been modifying the code to produce the following:

Result

This is the modified code:

M = Transpose[{{\[Infinity], -164.401, 153.329, 
     12.4378}, {0.00312139, \[Infinity], \[Infinity], \[Infinity]}, \
{0.0351193, \[Infinity], \[Infinity], \[Infinity]}, {-0.00452402, \
\[Infinity], \[Infinity], \[Infinity]}}]; (*Weighted adjacency matrix*)

G1 = WeightedAdjacencyGraph[{V, n, m, h}, M];
nodes = VertexList[G1];
degrees = DegreeCentrality[G1];
edges = EdgeList[G1];
weights = DeleteCases[Flatten[M], \[Infinity]];
G = Graph[G1, GraphLayout -> Automatic, PlotTheme -> "Monochrome", 
  VertexLabels -> Placed[Automatic, Center], 
  VertexSize -> Thread[nodes -> degrees/25], 
  EdgeStyle -> 
   MapThread[#1 -> {ColorData[{"TemperatureMap", "Reverse"}][
        Rescale[#2, Max[Abs[weights]] {-1, 1}, {0, 1}]], 
       Thickness[
        Interpolation[{{0, 0.004}, {Max[Abs[weights]], 0.008}}, 
         Abs[#2], InterpolationOrder -> 1]]} &, {edges, weights}]]

What I want now is to set edge colors and thicknesses in a way that doesn't vary linearly, exagerating distances to 0 in weight, so that small values could be seen a little bit more.

Any idea how to do something like this?

Thanks in advance!

Posted 6 years ago
POSTED BY: Jaebum Jung
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard