Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a question about visualization of network in Mathematica:

for example: for this network

g = ExampleData[{"NetworkGraph", "Friendship"}];

when we calculate ClosenessCentrality[g] and visualize with

HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> Rescale[%]]]

Mathematica graphics

We can not see the vertex of James. Why? The value exists and is positive.

share|improve this question
    
Try removing Rescale, as this will set the minimum of the list to 0, i.e. HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> ClosenessCentrality[g]]] –  Pinguin Dirk Jul 17 '13 at 11:27
    
Exactly!!! thank you for this fast response! –  Dural Akata Jul 17 '13 at 11:31
    
But we can not see the weight clearly? –  Dural Akata Jul 17 '13 at 11:34
    
See the documentation of Rescale for other parameters on how to rescale the output of ClosenessCentrality[g], e.g. Rescale[ClosenessCentrality[g], {0, 1}, {0.01, 1}] or any other transform (e.g. simply HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> 0.1 + Rescale[ClosenessCentrality[g]]]] ), whatever you desire! Not knowing what you actually want to achieve leaves me guessing –  Pinguin Dirk Jul 17 '13 at 11:42
    
I do it I understand Pinguin Dirk thank you! –  Dural Akata Jul 17 '13 at 11:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.