MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A question about Graphics3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107376] Re: A question about Graphics3D
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Thu, 11 Feb 2010 05:18:05 -0500 (EST)

On 2/10/10 at 3:35 AM, m.a.elwahaab at gmail.com (Marwa Abd El-Wahaab)
wrote:

>I am a Mathematica 7 user.

>I have two questions about Graphics3D[Point[my data]];

>*First question:* * * How can I color some points in my data in the
>above "Graphics3D" by different colors?

Add whatever colors you like in a list with the Point command.
For example,

setOne = RandomReal[1, {5, 3}];
setTwo = RandomReal[1, {5, 3}];

Show at Graphics3D[{PointSize[0.02], Red, Point[setOne], Green,
    Point[setTwo]}]

>*Second question:*

>How can I represent some points also in my data in the above
>"Graphics3D" by shapes like squares , some like triangles and some
>like circles ?

I don't think you can literally do what you want here. Circles,
squares and triangles are all 2D graphic objects which do not
work well with 3D graphics. But you can use different shapes
using an appropriate 3D primitive. For example,

here are colored boxes

Show@Graphics3D[{Red, Cuboid[# - .02, # + .02] & /@ setOne, Green,
    Cuboid[# - .02, # + .02] & /@ setTwo}]

And here are colored balls

Show@Graphics3D[{Red, Sphere[setOne, .02], Green, Sphere[setTwo, .02]}]

And while it is clearly possible to build any graphic you like
from primitives, for 3D plotting of data you might find
ListPointPlot3D more convenient.

ListPointPlot3D[{setOne, setTwo},
  PlotStyle -> {{PointSize[.015], Red}, {PointSize[.015], Green}}]



  • Prev by Date: Translating this algorithm into mathematica code
  • Next by Date: Re: A question about Graphics3D
  • Previous by thread: A question about Graphics3D
  • Next by thread: Re: A question about Graphics3D