# Plot Points in 3D with Label

I would like to plot points in 3D Space and show a number next to them.

How can I achieve this ?

Here is the list of coordinates / number :

(0 0 0)    //0
(35 0 0)   //1
(35 10 0)  //2
(0 10 0)   //3
(0 0 1)    //4
(35 0 1)   //5
(35 10 1)  //6
(0 10 1)   //7
(0 100 0)  //8
(35 100 0) //9
(0 100 1)  //10
(35 100 1) //11
(-20 0 0)  //12
(-20 0 1)  //13
(-20 10 0) //14
(-20 10 1) //15
(-20 100 0) //16
(-20 100 1) //17


In Mathematica Format:

corrd = {{0,0,0},{35,0,0},{35,10,0},{0,10,0},{0,0,1},{35,0,1},{35,10,1},{0,10,1},{0,100,0},{35,100,0},{0,100,1},{35,100,1},{-20,0,0},{-20,0,0},{-20,0,1},{-20,10,0},{-20,10,1},{-20,100,0},{-20,100,1}};

numb= Table[i,{i,0,17}];


I tryed ListPointPlot3D[corrd], but then I don't know how to show the number next to them ?

• Possible duplicate: mathematica.stackexchange.com/questions/61850/… – Michael E2 May 13 '17 at 18:00
• numb = Table[i,{0,17}] cannot work. Try: numb = Range[{0,17}] – David G. Stork May 13 '17 at 20:12
• @DavidG.Stork thanks for spotting the typo. Corrected it. – james May 14 '17 at 8:52

You can let the numbers be the markers, i.e., there isn't necessarily a need for points. You might also want to Style the numbers to make them easier to read.

corrd = DeleteDuplicates[{
{0, 0, 0}, {35, 0, 0}, {35, 10, 0}, {0, 10, 0},
{0, 0, 1}, {35, 0, 1}, {35, 10, 1}, {0, 10, 1},
{0, 100, 0}, {35, 100, 0}, {0, 100, 1}, {35, 100, 1},
{-20, 0, 0}, {-20, 0, 0}, {-20, 0, 1}, {-20, 10, 0},
{-20, 10, 1}, {-20, 100, 0}, {-20, 100, 1}}];

numb = Range[0, Length[corrd] - 1];

Graphics3D[
Text[
Style[
ToString[#[]],
14,
Bold,
ColorData["TemperatureMap"][#[[2, 3]]]], #[]] & /@
Transpose[{numb, corrd}],
BoxRatios -> {1, 1, 1/2},
Axes -> True] • Wow. Thanks a lot ! This is a very nice solution. – james May 13 '17 at 19:34

You can just use Graphics3D. Something like this can be done without any styling:

numb = Range;

Graphics3D[MapThread[{Red, Text[#2, #1], Point[#1]} &, {corrd, numb}],
Axes -> True, BoxRatios -> {1, 1, 0.5}]

• Nice ! Thanks a lot ! – james May 13 '17 at 14:16