4
$\begingroup$

I have the following code which I used to draw a 3D plot. The problem is that the labels {x,y,z} go out of the box and so it looks bad. Is it possible to to changing the location of 'x', 'y', and 'z'? or perhaps any better ways?

P0={0,0,0}; P1={1,0,0}; P2={0,1,0}; P3={0,0,1}; P4={1,1,1}; P5={-1,-1,-1};    

R[1]=ConvexHullMesh[{P0,P1,P2,P3},
       Frame->True,
       PlotRange -> Automatic,
       MeshCellStyle -> {{2,All} -> Opacity[.4, Red],{1,All} -> Black,{0,All} -> Blue}]

Show[Region[R[1], PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2},{-1.2,1.2}}, 
  Axes -> True,
  ImageSize -> Large,
  AxesOrigin -> {0,0,0},
  LabelStyle -> {8,Bold,Black}, 
  AxesLabel -> {x,y,z},
  AxesStyle -> Thick,
  Boxed->True]]
$\endgroup$

1 Answer 1

1
$\begingroup$

Something like this may be more to your liking:

Show[Region[R[1], PlotRange -> {{0, 1}, {0, 1}, {0, 1}}, Axes -> True,
   ImageSize -> Large, LabelStyle -> {16, Bold, Black}, 
  AxesLabel -> {x, y, z}, Ticks -> {{0, 0.5, 1}, {0.5, 1}, {0.5, 1}}, 
  AxesStyle -> Thick, Boxed -> True, ViewPoint -> Front]]

pic

$\endgroup$

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.