Function Repository Resource:

NumberedPointPlot

Source Notebook

Plot a list of points as numbered labels

Contributed by: Ed Pegg Jr

ResourceFunction["NumberedPointPlot"][list]

makes a graphic with numbered labels for the points in list.

Details

The points in list can be either coordinates or Point expressions.
NumberedPointPlot returns a Graphics object for a list of 2D points and a Graphics3D object for a list of 3D points.
NumberedPointPlot supports all options of Graphics (for the 2D case) and Graphics3D (for the 3D case).

Examples

Basic Examples (4) 

A list of coordinates:

In[1]:=
p = Round[9 CirclePoints[9]]
Out[1]=

Show the coordinates by their position in the list:

In[2]:=
ResourceFunction["NumberedPointPlot"][p]
Out[2]=

Rotate the points and make the image slightly larger:

In[3]:=
ResourceFunction["NumberedPointPlot"][RotateRight[p, 4], ImageSize -> {150, 150}]
Out[3]=

Change the style of the labels:

In[4]:=
ResourceFunction["NumberedPointPlot"][p, BaseStyle -> {Red, Large, Bold}]
Out[4]=

Scope (3) 

Use a list of Point expressions:

In[5]:=
p = Point /@ Round[9 CirclePoints[9]]
Out[5]=

Visualize it:

In[6]:=
ResourceFunction["NumberedPointPlot"][p]
Out[6]=

Approximate points for an offset icosahedron and a "bad" point, mixed:

In[7]:=
p = RandomSample[
  Join[RandomInteger[{-7, 7}, {1, 3}], {1, 2, 0} + # & /@ Round[7 PolyhedronData["Icosahedron", "VertexCoordinates"]]]]
Out[7]=

Show the points as a way to identify the bad one:

In[8]:=
ResourceFunction["NumberedPointPlot"][p]
Out[8]=

For points that make a simple polygon, show the indexed points within a minimal enclosing circle:

In[9]:=
pts = {{12, 2}, {22, 2}, {23, 11}, {17, 16}, {28, 27}, {12, 30}, {4, 20}, {4, 9}};
Graphics[{Cyan, BoundingRegion[pts, "MinDisk"],
  White, Polygon[pts],
  Black, ResourceFunction["NumberedPointPlot"][pts][[1]]}]
Out[10]=

The sixth point somewhat obfuscates the graphic, so maybe it should be lower.

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 06 September 2023

Related Resources

License Information