This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

VertexStyle

VertexStyle
is an option and property for Graph and related functions that specifies what style to use for vertices.
  • The following option settings can be used:
Automaticuse automatic setting for style
styleuse style for all vertices
{v1->style1,v2->style2,...}use for vertex
  • Vertices with no explicit vertex style are taken to use the automatic style.
  • The wrapper Style is equivalent to Property and can be used when creating graphs in functions such as Graph etc.
  • To specify multiple style directives use Directive.
  • Style and other specifications are effectively applied in the order VertexStyle, Style and other wrappers, and VertexShapeFunction, with later specifications overriding earlier ones.
Set the style for all vertices:
Specify the style for individual vertices:
Set the style for all vertices:
In[1]:=
Click for copyable input
Out[1]=
 
Specify the style for individual vertices:
In[1]:=
Click for copyable input
Out[1]=
VertexStyle can be used for general graphs:
Matrix graphs:
Special graphs:
Random graphs:
Use VertexStyle in a Property wrapper:
Alternatively, use a Style wrapper:
Use Directive to set multiple style directives:
VertexStyle can be combined with VertexShapeFunction:
VertexShapeFunction has higher priority than VertexStyle:
VertexStyle can be combined with BaseStyle:
VertexStyle has higher priority than BaseStyle:
VertexShape is not affected by VertexStyle:
New in 8