1
$\begingroup$

Just wondering, is it possible to remove certain 'line' of the box?

Show[Graphics3D[{Text[Style["x"], {3, -4.4, 1.1}], 
Text[Style["z"], {5, -4.4, .5}], 
Text[Style["y"], {5.33, -0.32, .15}]}], BoxRatios -> {.8, .6, .2}, 
ViewPoint -> {1.5, 1, .8}, ImageSize -> 52 8]
$\endgroup$
  • $\begingroup$ Are you looking for the option Boxed->False? If you still want axes you can add both, Boxed->False,Axes->True. $\endgroup$ – N.J.Evans Oct 18 '16 at 15:28
  • $\begingroup$ Putting 'Boxed-> False' will erase all of the box's line. Is there any other way to remove let say only one line of the box? @N.J.Evans $\endgroup$ – ssa Oct 18 '16 at 15:41
1
$\begingroup$

I would use graphics primitives and ImageScaled to roll my own. To get you started, here's a quick example, though it's not very flexible, or elegant.

topBox[] := {
   Line[{ImageScaled /@ {{0, 0, 1}, {1, 0, 1}}}],
   Line[{ImageScaled /@ {{0, 0, 1}, {0, 1, 1}}}],
   Line[{ImageScaled /@ {{1, 0, 1}, {1, 1, 1}}}],
   Line[{ImageScaled /@ {{0, 1, 1}, {1, 1, 1}}}]
   };
bottomBox[] := {
   Line[{ImageScaled /@ {{0, 0, 0}, {1, 0, 0}}}],
   Line[{ImageScaled /@ {{0, 0, 0}, {0, 1, 0}}}],
   Line[{ImageScaled /@ {{1, 0, 0}, {1, 1, 0}}}],
   Line[{ImageScaled /@ {{0, 1, 0}, {1, 1, 0}}}]
   };
uprights[] := {
  Line[{ImageScaled /@ {{0, 0, 0}, {0, 0, 1}}}],
  Line[{ImageScaled /@ {{1, 0, 0}, {1, 0, 1}}}],
  Line[{ImageScaled /@ {{1, 1, 0}, {1, 1, 1}}}],
  Line[{ImageScaled /@ {{0, 1, 0}, {0, 1, 1}}}],
  }

Show[
 Graphics3D[{
   Text[Style["x"], {3, -4.4, 1.1}],
   Text[Style["z"], {5, -4.4, .5}],
   Text[Style["y"], {5.33, -0.32, .15}],
   Red,
   bottomBox[],
   Blue,
   uprights[],
   Green,
   topBox[]
   }],
 BoxRatios -> {.8, .6, .2},
 ViewPoint -> {1.5, 1, .8},
 ImageSize -> 52 8
 , Boxed -> False
 ]

Which will produce: enter image description here

Then it's up to you to decide which lines you want to plot.

$\endgroup$

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.