RemoveProperty

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)

Remove a vertex or edge property:

Scope  (4)

Basic Uses  (2)

Remove one property from vertices:

And from edges:

Remove all properties from vertices:

And from edges:

Remove several properties from vertices:

And from edges:

Vertex Properties  (1)

Set several properties for a graph:

Remove vertex properties including VertexStyle:

VertexLabels:

VertexSize:

VertexShape:

VertexShapeFunction:

A custom property:

Edge Properties  (1)

Set several properties for a graph:

Remove edge properties including EdgeStyle:

EdgeLabels:

EdgeShapeFunction:

A custom property:

Applications  (1)

Use Fold to apply RemoveProperty repeatedly:

See all the partial results:

Properties & Relations  (6)

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

Use PropertyValue to extract values:

For undefined properties, the value $Failed is returned:

Use PropertyValue to set properties in a graph:

The original graph has changed:

Use PropertyValue to unset properties in a graph:

The original graph has changed:

Use PropertyList to test for the presence of a property:

Generate a list of vertex label rules:

Use SetProperty to set a property without changing the original:

The original graph is unchanged:

Possible Issues  (1)

PropertyValue is typically faster than RemoveProperty:

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).

CMS

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_removeproperty, organization={Wolfram Research}, title={RemoveProperty}, year={2015}, url={https://reference.wolfram.com/language/ref/RemoveProperty.html}, note=[Accessed: 07-December-2024 ]}