15
$\begingroup$

When I Plot a Graphics3D with samething like

Axes -> True, 
AxesLabel -> {"X ",  "Y ", "Z "},
Ticks -> {Range[-10, 10],  Range[-10, 10], Range[-10, 10]}

how could I specialized which ridge the AxesLabel and Ticks should located? I know in 2D plot this could be done with FrameTicks. However, in 3D, there are 12 edges. For every X-ticks or Y-ticks, there are 4 edges where ticks could be labeled. For example, Graphics3D[Cylinder[], Axes -> True] and Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}] chose different edges for Y-label.

Mathematica automatically chose the certain edge, the problem is, how could I appoint a different one?

$\endgroup$
3
  • $\begingroup$ Because this changes dynamically when you rotate Graphics3D[], I don't think this can be specified. $\endgroup$
    – Feyre
    Jul 11, 2016 at 15:28
  • $\begingroup$ can't it be specified for a given view angle/polit? @Feyre $\endgroup$
    – Harry
    Jul 11, 2016 at 15:31
  • $\begingroup$ That was my immediate thought too, there's nothing in the documentation though. $\endgroup$
    – Feyre
    Jul 11, 2016 at 15:37

1 Answer 1

18
$\begingroup$

Update

AxesEdge does what you want.

Graphics3D[Cylinder[], Axes -> True, AxesEdge -> {{-1, 1}, {1, -1}, {1, -1}}]

enter image description here

The following shows more specifically how each of the edges are selected:

p1 = Graphics3D[Cylinder[], Axes -> True, 
   AxesEdge -> {{1, 1}, None, None}, ViewPoint -> Left,  PlotLabel -> "x {1,1}"];
p2 = Graphics3D[Cylinder[], Axes -> True, 
   AxesEdge -> {{-1, 1}, None, None}, ViewPoint -> Left, PlotLabel -> "x {-1,1}"];
p3 = Graphics3D[Cylinder[], Axes -> True, 
   AxesEdge -> {{-1, -1}, None, None}, ViewPoint -> Left, PlotLabel -> "x {-1,-1}"];
p4 = Graphics3D[Cylinder[], Axes -> True, 
   AxesEdge -> {{1, -1}, None, None}, ViewPoint -> Left,  PlotLabel -> "x {1,-1}"];

GraphicsRow[{p1, p2, p3, p4}, ImageSize -> Full]

enter image description here


You can use AxesOrigin to specify which location the axes originate. This point and axes will stay fixed as you rotate the graph.

Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, AxesOrigin -> {0, 0, -1}, Boxed -> False]

enter image description here

$\endgroup$
2
  • $\begingroup$ Partial solution as this limits the labelled axes to any three from the same origin. $\endgroup$
    – Feyre
    Jul 11, 2016 at 15:35
  • $\begingroup$ @Feyre now it's a full solution $\endgroup$
    – Young
    Jul 11, 2016 at 15:48

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.