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'm constructing a graph using GraphPlot and I want some vertices to have a different size than others, like this:

GraphPlot[{1 -> 2, 2 -> 3}, VertexSize -> {{1, 3} -> Medium}]

However this gives errors. How do I set sizes of individual nodes?

share|improve this question

closed as off-topic by Sjoerd C. de Vries, belisarius, Yves Klett, rasher, Michael E2 May 22 at 0:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Sjoerd C. de Vries, belisarius, Yves Klett, rasher, Michael E2
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 4 down vote accepted

The correct way is the following:

Graph[{1 -> 2, 2 -> 3}, VertexSize -> {1 -> Medium, 3 -> Medium}]

Two mistakes had to be corrected:

GraphPlot doesn't create a graph, it just visualizes one, and it doesn't have a VertexSize option. This is a leftover function from earlier version which is nearly completely replaced by Graph now.

VertexSize -> {{1, 3} -> Medium} should be VertexSize -> {1 -> Medium, 3 -> Medium}. Thread[{1,3} -> Medium] will save typing.

share|improve this answer

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