PropertyValue

PropertyValue[{obj, item}, name]
gives the property value associated with name for item in obj.

DetailsDetails

  • Properties are used to store and manipulate pairs for specific named items within an object such as Graph.
  • PropertyValue[{obj, item}, name] returns $Failed whenever there is no property value available for name.
  • PropertyValue[{obj, item}, name]=val can be used to modify the property value.
  • The items available for Graph objects include vertices and edges.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Generate a complete graph with properties:

In[1]:=
Click for copyable input
Out[1]=

Retrieve the property value associated with property name:

In[2]:=
Click for copyable input
Out[2]=

Change the property value:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Unset the property value:

In[5]:=
Click for copyable input
In[6]:=
Click for copyable input
Out[6]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »