15
$\begingroup$

I might be doing something stupid, but I can't see what it is. This simple example shows that I'm trying to hide the Box, but failing. (I tried it just once, in different positions, too.) The code is a little weird, so that might be the problem...

splot1 = SphericalPlot3D[
   Cos[\[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, Pi}, Mesh -> None, 
   Boxed -> False, PlotPoints -> 80];

aGraphicsComplex = splot1[[1]];

Graphics3D[{Boxed -> False, 
  Lighting -> {{"Point", RGBColor[1, .9, .9], {2, 2, 4}}}, 
  Boxed -> False,
  aGraphicsComplex /. GraphicsComplex[pts_, objs__] :> 
    GraphicsComplex[
     With[{r = 4 Sin[11 (ArcTan[#[[1]], #[[2]]] + #[[3]] )]},
        {r, r, 2} #] & /@ pts, objs]}]

the box that won't go away

$\endgroup$

2 Answers 2

19
$\begingroup$

This should work as you need to feed the option Boxed -> False to Graphics3D and option should be given after the argument in a function.

splot1 = SphericalPlot3D[
Cos[θ], {θ, 0, Pi}, {ϕ, 0, Pi}, Mesh -> None, 
PlotPoints -> 80];
aGraphicsComplex = splot1[[1]];
Graphics3D[{Lighting -> {{"Point", RGBColor[1, .9, .9], {2, 2, 4}}}, 
aGraphicsComplex /. 
GraphicsComplex[pts_, objs__] :> 
GraphicsComplex[
 With[{r = 4 Sin[11 (ArcTan[#[[1]], #[[2]]] + #[[3]])]}, {r, r, 
      2} #] & /@ pts, objs]}, Boxed -> False]

enter image description here

$\endgroup$
2
  • $\begingroup$ Right! Thanks for correcting.. $\endgroup$ Mar 2, 2012 at 10:07
  • $\begingroup$ @PlatoManiac Thanks! $\endgroup$
    – cormullion
    Mar 2, 2012 at 11:30
11
$\begingroup$

Boxed -> False is an option of Graphics3D so it must come after the first argument, not as part of it in a list.

Graphics3D[{...}, Boxed -> False]

This is valid for the other options too, just move them to the end.

$\endgroup$
2
  • $\begingroup$ Thanks. I suppose I must have thought that both Mesh and Box options would make their way through from SphericalPlot3D to Graphics3D... $\endgroup$
    – cormullion
    Mar 2, 2012 at 11:30
  • $\begingroup$ @cormullion They won't because you are specifically picking out the graphics objects only without any options when you do splot1[[1]] $\endgroup$
    – Szabolcs
    Mar 2, 2012 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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