Message Boards Message Boards

0
|
8547 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to arbitrarily label the points in ListPointPlot3D?

Posted 8 years ago

Hi,

I am trying to label some points in 3D plot as follows:

data = {{0.000, 0.000, 0.000}, {-1.612, 8.077, -2.474}, {-19.599, 2.4,
     3.4}};
dataplot = ListPointPlot3D[data, PlotStyle -> PointSize[Large]];
data1 = Prepend[Text[{"Sun", "Sirius", "Mars"}], data]'
Show[dataplot]

I am using Mathematica Home Edition 10 on Windows OS.

Thanks

POSTED BY: vick ratnam
3 Replies
Posted 8 years ago

You want Text["name",{x,y,z}] for each label. One way to get that is

data = {{0.000, 0.000, 0.000}, {-1.612, 8.077, -2.474}, {-19.599, 2.4, 3.4}};
dataplot = ListPointPlot3D[data, PlotStyle->PointSize[Large]];
textplot = Graphics3D[ Map[Text @@ # &, Transpose[{{"Sun", "Sirius", "Mars"}, data}]]];
Show[textplot, dataplot]

Look up each of those items in the help pages, try simple examples and see if you can figure this out for the next time you need it.

POSTED BY: Bill Simpson
Posted 8 years ago

Hi,

Thanks for replying!

Well I knew about Graphics and Text but I didn't know about Map and Transpose.

However, how do you put Style in that line? I want to print the text in Bold Blue.

I'm actually trying to manipulate this graphics.

My real code is as follows:

data2 = {{0.000, 0.000, 0.000}, {-1.612, 8.077, -2.474}, {-19.599, 
    186.849, -246.583}, {-29.000, -19.499, 
    12.157}, {-1.646, -1.375, -3.842}, {3.127, -19.235, 
    15.660}, {167.744, 834.512, -122.686}, {-5.353 , 9.547, 
    1.096}, {13.369, 634.519, 82.506}, {36.150, 235.772, 
    26.543}, {5.481, 28.657, 30.211}, {22.354, 58.173, 
    18.471}, {-206.890, -495.847, -267.081}, {-13.242 , 26.759, 
    16.267}, {-17.712 , 40.444, 27.470}, {-66.567, 35.256, 
    15.966}, {-1224.806, 
    3234.005, -1669.329}, {-1.546, -1.183, -3.769}, {-0.057, -5.943, 
    0.488}, {-7.430 , 2.113, 0.950}, {-6.506 , 1.642, 
    4.870}, {1.910, -8.647, -3.912}, {6.213, 8.314, -1.729}, {10.287, 
    5.021, -3.269}, {6.468, -2.746, 
    11.114}, {14.243, -4.268, -3.780}, {-24.260 , 25.880, 
    19.125}, {-24.952, -8.886, -8.766}, {45.832, -12.825, 
    18.049}, {7.807, -14.872, 2.621}, {68.981, 
    31.332, -117.728}, {20.933, -5.840, -12.357}, {-237.661, -92.652, \
-50.329}, {4.354, 3.396, 429.965}, {1184.687, -1394.076, 
    1847.449}, {47.862, 51.402, 
    60.959}, {-172.829, -36.515, -302.153}, {4.898, -32.843, 42.075}};
text2 =  Graphics3D[
   Map[Text @@ # &, 
    Transpose[{{"Sun", "Sirius", "Canopus", "Arcturus", "Rigil K", 
       "Vega", "Rigel", "Procyon", "Betelgeuse", "Bellatrix", 
       "Capella", "Aldebaran", "Antares", "Pollux", "Castor", 
       "Regulus", "VY Canis M", "Proxima C", "Barnard", "Wolf 359", 
       "Lalande 21185", "Ross 154", "Epsilon Eri", "Tau Ceti", 
       "Kruger 60", "Gliese 876", "55 Cancri", "61 Virginis", 
       "51 Pegasi", "Altair", "Achernar", "Fomalhaut", "Spica", 
       "Polaris", "Deneb", "Algol", "Mimosa", "BY Draconis"}, 
      data2}]]];
Manipulate[
 ListPointPlot3D[data2, PlotRange -> {{-n, n}, {-n, n}, {-n, n}}, 
  BoxRatios -> {1, 1, 1}, AxesLabel -> {X, Y, Z}, 
  LabelStyle -> Directive[Blue, Bold], ImageSize -> {700}, 
  PlotStyle -> Directive[Blue, PointSize[Large]]], {n, 1 , 4000}]

Can you help me print the Text labels in Bold Blue within the Manipulate context?

Thanks

POSTED BY: vick ratnam
Posted 8 years ago

Perhaps something like this?

text2 = Graphics3D[{Blue, Map[Style[Text[Sequence @@ #], Bold] &, 
  Transpose[{{"Sun", "Sirius", "Canopus", "Arcturus", "Rigil K", "Vega", "Rigel", "Procyon",
    "Betelgeuse", "Bellatrix", "Capella", "Aldebaran", "Antares", "Pollux", "Castor", "Regulus",
    "VY Canis M", "Proxima C", "Barnard", "Wolf 359", "Lalande 21185", "Ross 154",
    "Epsilon Eri", "Tau Ceti", "Kruger 60", "Gliese 876", "55 Cancri", "61 Virginis", "51 Pegasi",
    "Altair", "Achernar", "Fomalhaut", "Spica", "Polaris", "Deneb", "Algol", "Mimosa",
    "BY Draconis"}, data2}]]}];
  Manipulate[Show[ListPointPlot3D[data2, PlotRange -> {{-n, n}, {-n, n}, {-n, n}},
    BoxRatios -> {1, 1, 1}, AxesLabel -> {X, Y, Z}, LabelStyle -> Directive[Blue, Bold],
    ImageSize -> {700}, PlotStyle -> Directive[Blue, PointSize[Large]]], text2], {n, 1, 4000}]

But tweaking graphics presentation details is getting farther and farther from what I have any skill to do.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract