1
$\begingroup$

I want to get a point or the Sphere[] Graphics3D object to have a border or edge in a 3D scatter plot. The EdgeForm[] directives seem to apply only to polygon objects. The effect I am trying to get is shown below as white borders on points or spheres (generated using Matlab) enter image description here

$\endgroup$
2
  • $\begingroup$ maybe something like Graphics3D[{ Opacity[.5], Black, Ball[{1, 1, 1}, 1.1], Opacity@9, Orange, Sphere[{1, 1, 1}], Red, AbsolutePointSize[20], Point[{2, 2, 2}], AbsolutePointSize[15], Blue, Point[{2, 2, 2}], Point[{3, 3, 3}]}, PlotRange -> {{-1, 4}, {-1, 4}, {-1, 4}}]? $\endgroup$
    – kglr
    Oct 11, 2020 at 18:23
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$ Oct 12, 2020 at 12:54

1 Answer 1

3
$\begingroup$

Perhaps this is the look you are going for. I had to make up the data as you did not share it. Please do next time together with code to understand better what does not work for you. There are some tricks in the code below - check all functions in docs to understand how they work.

One way to do this is very simple - put a white hallo around points with another identical set of slightly larger points - and play with opacity too and point sizes.

data=Flatten[Table[{x,y,300+1200/(1+x^2+y^2)}+RandomReal[.1{-1,1},3],
{x,0,3,.02},{y,0,2,.02}],1];

ListPointPlot3D[{data,data},
BoxRatios->1,PlotRange->{{0,3},{0,3},{0,1500}},PlotTheme->"Detailed",
PlotStyle->{
    Directive[White,Opacity[.8],PointSize[.01]],
    Directive[Blue,Opacity[.8],PointSize[.0085]]}]

enter image description here

Another way is 3D. Main thing is using an Ellipsoid because BoxRatios would deform spheres with your aspect ratios and use Opacity and Specularity to improve effect.

data=Flatten[Table[{x,y,300+1200/(1+x^2+y^2)}+RandomReal[.1{-1,1},3],{x,0,3,.02},{y,0,2,.02}],1];

DynamicModule[{v={1.3,-2.4,2}},

Graphics3D[{Orange,Specularity[White,20],Opacity[.5],Ellipsoid[#,10{3,3,1500}/1500.]&/@data},
BoxRatios->1,PlotRange->{0,1500},ImageSize->800,Axes->True,
FaceGrids->Dynamic[Sign/@DiagonalMatrix[-v]],ViewPoint->Dynamic[v]]

]

enter image description here

$\endgroup$
1
  • $\begingroup$ While this is a hack, your ingenious method does give the required effect! Thanks! $\endgroup$ Oct 13, 2020 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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