I'm aware of two ways to manage positioning of Axes for Graphics3D: AxesOrigin and AxesEdge. They seem to be quite different in terms of what is actually happening:

             Graphics3D[##, AxesOrigin -> {0, 0, 0}], 
             Graphics3D[##, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}]
            } &[Sphere[{1, 1, 1}, 1], Axes -> True, ViewPoint -> {5, 7, 3}]]

enter image description here

I want the graphics elements to be up front.

For axes being a part of the box it is natural to use AxesEdge since it gives me that effect.

However sometimes I want the axes origin to be inside the box. AxesEdge is useless and AxesOrigin creates strange effect:

Graphics3D[{Opacity@1, Sphere[{1, 1, 1}, 1]}, Axes -> True, AxesOrigin -> {1, 1, 1}]

enter image description here

Axes created with AxesOrigin seem to be different object than with AxesEdge. It looks like some kind of 2D projection in front of 3D graphics while AxesEdge creates something which is part of 3D graphics.

As one may know there (..find undocumented options...) is an undocumented option Method -> { "AxesInFront" -> False } to deal with this issue in $2D$ graphics.

It doesn't seem to work in $3D$. So my question is if anyone is aware of, maybe undocumented, option responsible for that.

If this is a projection it could be behind the Graphics3D objects too, couldn't it be? (that's a little bit naive, in form, question since I do not know much about graphics rendering etc)

P.s. I do not expect answers like "You can use FindDivisions+Line" etc. I'm looking for simple and fast solution. Or an answer that there isn't any. (spelunking appreciated too:))

  • $\begingroup$ fyi, I do not get the same image in your first draw. I get this !Mathematica graphics (on winows 7, V 9.01) $\endgroup$ – Nasser Sep 12 '13 at 8:09
  • 1
    $\begingroup$ @Nasser done. try now. $\endgroup$ – Kuba Sep 12 '13 at 8:13
  • 3
    $\begingroup$ spelnuking - is that when you nuke your spelling? $\endgroup$ – Simon Woods Sep 12 '13 at 15:05
  • 1
    $\begingroup$ @SimonWoods ehh. one could just check my posts looking for funny typos and it would be all week long game :P Thanks. $\endgroup$ – Kuba Sep 12 '13 at 15:06
  • $\begingroup$ Related: Arrows on axes in Plot3D $\endgroup$ – Jens Sep 13 '13 at 4:03

If I understand correctly, in the case of your sphere you'd like the sphere to obscure your axes and ticks, except perhaps for a little bit where they poke out at the edges.

This isn't currently possible without writing your own axes using Line and Inset.

The "AxesInFront" and other "...InFront" method options only apply to Graphics which doesn't have a natural $z$-order.

  • $\begingroup$ Hello, I believe we haven't talk ever before. Ok, judging by you profile it seems to be a final answer. :) But let me ask you about some detailas or the refference about my thoughts about nature of axes in graphics3D, do not leave me with only intuitive understanding. :) $\endgroup$ – Kuba Sep 13 '13 at 5:12
  • $\begingroup$ And yes, you understand correctly. Also, forgive me my curiosity, but the fact you have written ""AxesInFront" and other "...InFront" options", while here we are aware of only Axes and GridLines, 'forces' me to ask about some 'other' examples :) $\endgroup$ – Kuba Sep 13 '13 at 6:17
  • 3
    $\begingroup$ There's also "FrameInFront" but you're much less likely to run into cases where it might be useful. $\endgroup$ – Brett Champion Sep 13 '13 at 15:44

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.