Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

In ListPointPlot3D, it seems the only point style available is the default, because there is no PlotMarkers option for this function. Is there a way to change the point style? For example, what if I want to draw the points as small cubes?

share|improve this question
1  
And where such arrow should be directed to? –  Kuba May 27 at 8:41
add comment

1 Answer 1

up vote 9 down vote accepted
lpdata = Table[(4 Pi - t) {Cos[t + Pi/2], Sin[t + Pi/2], 0} + {0, 0, t}, {t, 0, 4 Pi, .1}];

lpp1 = ListPointPlot3D[lpdata, 
        Filling -> Bottom,  ColorFunction -> "Rainbow", BoxRatios -> 1, 
        FillingStyle -> Directive[LightGreen, Thick, Opacity[.5]],  ImageSize -> 400];

ListPointPlot3D: Post-process Point into Cone

lpp2 = lpp1 /. Point[x__] :> (Sequence@{EdgeForm[], Cone[#, .3]} &@
            ({x} /. {{a_, b_, c_}} :> {{a, b, c}, {a, b, .5 + c}}));

Row[{lpp1, lpp2}, Spacer[5]]

enter image description here

... or into Cuboids

lpp1 /. Point -> Cuboid

enter image description here

DiscretePlot3D: use lpdata do define a function and use the option PlotMarkers

ClearAll[foo];
(foo[Sequence @@ #[[1]]] = #[[2]]) & /@ (lpdata /. {a_, b_, c_} :> {{a, b}, c});
(* or  (foo[Sequence @@ #1] = #2) & @@@ (lpdata /. {a_, b_, c_} :> {{a, b}, c})*) 
 DiscretePlot3D[foo[x, y], {x, lpdata[[All, 1]]}, {y, lpdata[[All, 2]]}, 
   ImageSize -> 400, BoxRatios -> 1, ExtentSize -> 1/5, 
   ColorFunction -> Function[{x, y, z}, ColorData["Rainbow"][z]], 
   PlotMarkers -> {"Sphere", Medium}]

enter image description here

(Unfortunately, Point and Sphere seem to be the only markers that work with DiscretePlot3D.)

BubbleChart3D: append lpdata with 1s and use the options ChartElements or ChartElementFunction

bcdata = {##, 1} & @@@ lpdata;
opts = {ImageSize -> 300, BubbleSizes -> {0.025, .025},
       ChartBaseStyle -> EdgeForm[], ChartStyle -> "Rainbow", ColorFunction -> (#3 &)};

Use the built-in glyphs with the option ChartElementFunction:

Row[BubbleChart3D[bcdata, Evaluate@opts,
   ChartElementFunction -> #] & /@ {"Cone", "Cube","TriangleWaveCube"}, Spacer[5]]

enter image description here

or use the option ChartElements and provide your own graphics objects:

 Row[BubbleChart3D[bcdata, Evaluate@opts, ChartElements -> Graphics3D[#]] & /@ 
       {Cone[], Cuboid[], PolyhedronData["Dodecahedron", "Faces"]}, Spacer[5]]

enter image description here

share|improve this answer
    
Very nice, especially the direct "lpp1 /. Point -> Cuboid" –  eldo May 27 at 12:51
    
Thank you @eldo... –  kguler May 27 at 14:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.