Skip to main content
edited tags
Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Tweeted twitter.com/#!/StackMma/status/311017656461447169
Source Link
Tony Dong
  • 899
  • 9
  • 18

Remove the white margins of a Graphics3D figure

If the option Boxed is set to be False in Graphics3D, additional white margins may appear as shown in the following figure. Is it possible to remove the useless margins such that the borders touch the contents?

smallarray = 
 With[{L0 = 300, r0 = 50, unitcellsize = 400, origin = {0, 0, 0}, 
   la = 800, ra = 50 },
  Graphics3D[{EdgeForm[None], Yellow, 
    Table[{Cylinder[{{ix*unitcellsize, iy*unitcellsize - L0/2, 
         0}, {ix*unitcellsize, iy*unitcellsize + L0/2, 0}}, r0]}, {ix,
       1, 5}, {iy, 1, 5}], Arrowheads[0.1], Red, 
    Arrow[Tube[{origin, origin + {la, 0, 0}}, ra]], Magenta, 
    Arrow[Tube[{{0, 0, 0}, origin + {0, la, 0}}, ra]], Cyan, 
    Arrow[Tube[{origin, origin + {0, 0, la}}, ra]]}, Boxed -> False, 
   Lighting -> Automatic, ViewPoint -> {Pi, Pi/2, Pi}, 
   ImageSize -> {Automatic, 400}]]

enter image description here