WOLFRAM

As of Version 12.1, RemoveProperty has been superseded by AnnotationDelete.

RemoveProperty[{obj,itemspec}]

removes all properties associated with itemspec in obj.

RemoveProperty[{obj,itemspec},name]

removes the property name associated with itemspec in obj.

Details

  • Properties are used to store and manipulate name->value pairs for specific named items within an object such as Graph, MeshRegion, and BoundaryMeshRegion.
  • RemoveProperty will produce an object with the specified property removed.
  • The item specification itemspec typically has the form {collection,index}.
  • The index can typically have the following forms:
  • inda single index
    {ind1,ind2,}a list of indexes
    Allall possible indexes in collection
    pattindexes that match patt in collection
  • The collection can typically have the following forms:
  • cola single collection
    {col1,col2,}a list of collections
    Allall possible collections
    pattcollections that match patt
  • The item specification itemspec of the form collection refers to the default value for all indexes in the collection.
  • For standard properties, RemoveProperty effectively resets the value to the property default value.
  • Objects that support properties include Graph, MeshRegion, and BoundaryMeshRegion. Item specifications for each type of object is given in their reference pages.

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Remove a vertex or edge property:

Out[1]=1
Out[2]=2

Scope  (4)Survey of the scope of standard use cases

Basic Uses  (2)

Remove one property from vertices:

Out[1]=1
Out[2]=2

And from edges:

Out[3]=3

Remove all properties from vertices:

Out[4]=4

And from edges:

Out[5]=5

Remove several properties from vertices:

Out[1]=1

And from edges:

Out[2]=2

Vertex Properties  (1)

Set several properties for a graph:

Out[41]=41
Out[47]=47

Remove vertex properties including VertexStyle:

Out[48]=48

VertexLabels:

Out[49]=49

VertexSize:

Out[50]=50

VertexShape:

Out[51]=51

VertexShapeFunction:

Out[52]=52

A custom property:

Out[16]=16
Out[18]=18

Edge Properties  (1)

Set several properties for a graph:

Out[27]=27
Out[33]=33

Remove edge properties including EdgeStyle:

Out[9]=9

EdgeLabels:

Out[11]=11

EdgeShapeFunction:

Out[20]=20

A custom property:

Out[24]=24
Out[26]=26

Applications  (1)Sample problems that can be solved with this function

Use Fold to apply RemoveProperty repeatedly:

Out[1]=1
Out[2]=2

See all the partial results:

Out[3]=3

Properties & Relations  (6)Properties of the function, and connections to other functions

Use Property as a wrapper to specify properties in functions such as Graph:

Out[1]=1

Use PropertyValue to extract values:

Out[1]=1
Out[2]=2

For undefined properties, the value $Failed is returned:

Out[3]=3
Out[4]=4

Use PropertyValue to set properties in a graph:

Out[1]=1

The original graph has changed:

Out[3]=3

Use PropertyValue to unset properties in a graph:

Out[1]=1

The original graph has changed:

Out[3]=3

Use PropertyList to test for the presence of a property:

Out[1]=1
Out[2]=2

Generate a list of vertex label rules:

Out[3]=3

Use SetProperty to set a property without changing the original:

Out[1]=1
Out[2]=2

The original graph is unchanged:

Out[3]=3

Possible Issues  (1)Common pitfalls and unexpected behavior

PropertyValue is typically faster than RemoveProperty:

Out[2]=2
Out[4]=4
Wolfram Research (2010), RemoveProperty, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoveProperty.html (updated 2015).
Wolfram Research (2010), RemoveProperty, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoveProperty.html (updated 2015).

Text

Wolfram Research (2010), RemoveProperty, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoveProperty.html (updated 2015).

Wolfram Research (2010), RemoveProperty, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoveProperty.html (updated 2015).

CMS

Wolfram Language. 2010. "RemoveProperty." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/RemoveProperty.html.

Wolfram Language. 2010. "RemoveProperty." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/RemoveProperty.html.

APA

Wolfram Language. (2010). RemoveProperty. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoveProperty.html

Wolfram Language. (2010). RemoveProperty. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoveProperty.html

BibTeX

@misc{reference.wolfram_2025_removeproperty, author="Wolfram Research", title="{RemoveProperty}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/RemoveProperty.html}", note=[Accessed: 06-June-2025 ]}

@misc{reference.wolfram_2025_removeproperty, author="Wolfram Research", title="{RemoveProperty}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/RemoveProperty.html}", note=[Accessed: 06-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_removeproperty, organization={Wolfram Research}, title={RemoveProperty}, year={2015}, url={https://reference.wolfram.com/language/ref/RemoveProperty.html}, note=[Accessed: 06-June-2025 ]}

@online{reference.wolfram_2025_removeproperty, organization={Wolfram Research}, title={RemoveProperty}, year={2015}, url={https://reference.wolfram.com/language/ref/RemoveProperty.html}, note=[Accessed: 06-June-2025 ]}