# Plotting vector points efficiently?

**URL:** <https://community.wolfram.com/t/plotting-vector-points-efficiently/9177>\
**Category:** Questions\
**Tags:** geometry, graphics-and-visualization\
**Created:** [August 31, 2016, 4:13pm UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177 "2016-08-31T16:13:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![masandlin](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@masandlin](https://community.wolfram.com/u/masandlin)\
**Post date:** [August 31, 2016, 4:13pm UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177/1 "2016-08-31T16:13:38Z")

</div>

Is there a better way of plotting a series of vector points (x,y) than using the Graphics[] command, see attached. I am just trying to visualize all the individual vector points to get an idea of the total graph; however my method seems awful crude and not very visually appealing?

```
p1=Graphics[{PointSize[Large],Black,Point[{0,0}],Text["(0,0)",{0,0.1}]}];
p2=Graphics[{PointSize[Large],Black,Point[{4,0}],Text["(4,0)",{4,0.1}]}];
p3=Graphics[{PointSize[Large],Black,Point[{4,2}],Text["(4,2)",{4,2.1}]}];
p4=Graphics[{PointSize[Large],Black,Point[{0,2}],Text["(0,2)",{0,2.1}]}];

Show[p1,p2,p3,p4]

```

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [August 31, 2016, 4:55pm UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177/2 "2016-08-31T16:55:34Z")

</div>

Hi,

if this is a list of points:

```
list = {{0, 0}, {4, 0}, {4, 2}, {0, 2}};

```

then this would generate your plot:

```
Graphics[{PointSize[Large], Black, Point[#], Text["(" <> StringTake[ToString[#], 2 ;; -2] <> ")", # + {0, 0.1}]} & /@ list]

```

 ![ScreenShot2016-08-31at17.52.33.png](https://global.discourse-cdn.com/wolfram/original/3X/9/1/917f32be9d78576d4f57df99ff73eefd4bfeb9a0.png)

Cheers,

Marco

PS: The labelling can be done more elegantly.

---

<div class="post-metadata">

**Author:** ![bgoodman11](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/bgoodman11/32/23878_2.png) [@bgoodman11](https://community.wolfram.com/u/bgoodman11)\
**Post date:** [August 31, 2016, 5:02pm UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177/3 "2016-08-31T17:02:32Z")

</div>

I’m late but I believe the labelling here should satisfy a more elegant approach.

```
pts = {
   {0, 0}, {4, 0}, {4, 2}, {0, 2}
   };

Graphics[{
  {PointSize[Large], Point[pts]},
  Inset[#, # + {0, 0.2}] & /@ pts
  }]

```

Alternatively, moving away from Graphics,

```
ListPlot[Labeled[#, #] & /@ pts, Axes -> False]

```

and generally, for any list of vectors

```
plotVec = 
  Function[{pts}, 
   ListPlot[Labeled[#, #] & /@ pts, Axes -> False, PlotRange -> All]];

```

all produce the same output.

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [August 31, 2016, 7:07pm UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177/4 "2016-08-31T19:07:16Z")

</div>

Hi Ben,

you are right. But your labels contain curly brackets. Much of my labelling code is to replace them by round ones. Also I was not sure whether it was relevant that the labels be text like in the OP. I also wanted to maintain the Graphics structure.

Your Graphics suggestion with the parenthesis replaced could look like this:

```
pts = {{0, 0}, {4, 0}, {4, 2}, {0, 2}};

Graphics[{{PointSize[Large], Point[pts]}, 
  Inset[StringReplace[
      ToString[#], {"{" -> "(", "}" -> ")"}], # + {0, 0.2}] & /@ pts}]

```

or this if the Text is not required:

```
Graphics[{{PointSize[Large], Point[pts]}, Inset[MatrixForm[{#}], # + {0, 0.1}] & /@ pts}]

```

Cheers,

M.

---

<div class="post-metadata">

**Author:** ![bgoodman11](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/bgoodman11/32/23878_2.png) [@bgoodman11](https://community.wolfram.com/u/bgoodman11)\
**Post date:** [August 31, 2016, 7:24pm UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177/5 "2016-08-31T19:24:30Z")

</div>

Ah, I missed the detail of the parenthesis vs. brackets in the OP. Thanks.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [September 1, 2016, 8:29am UTC](https://community.wolfram.com/t/plotting-vector-points-efficiently/9177/6 "2016-09-01T08:29:42Z")

</div>

You may try ListPlot with Labeled:

```
pts = {{0, 0}, {1/2, 1/2}, {1, 1}};
ListPlot[Map[Labeled[#, TraditionalForm[{#}]] &, pts]]

```
