4

This code:

arrowAxes[arrowLength_] := 
  Map[{Apply[RGBColor, #], Arrow[Tube[{{0, 0, 0}, #}]]} &, arrowLength IdentityMatrix[3]];

Graphics3D[
  {Sphere[{1, 1, 1}], arrowAxes[3]},
  Axes -> True,
  Boxed -> False, 
  AxesOrigin -> {0, 0, 0},
  AxesStyle -> Opacity[0], 
  TicksStyle -> Opacity[1]]

will produce these plots:

enter image description here

enter image description here

enter image description here

How not to display tick and labels that are behind the sphere? (this is the case in the first and second picture above; third picture is correct in that sense, since blue axis is in front of the sphere)


There is a suspicion that this may be a bug, related to AxisOrigin. Therefore, I am adding tag "bugs".

Adrian
  • 411
  • 4
  • 14
  • 1
    I think you need AxesEdge like in this question Method -> {“AxesInFront” -> False} for Graphics3D. But I'm not sure because you want to hide ticks behind Sphere and then you are saying that the third example is correct... – Kuba Nov 21 '14 at 13:13
  • Thanks, @Kuba, it looks the question you linked could be truly useful; the third example is right, the reason is blue axis is in front of the sphere, seen from the viewer, for that particular coordinate system placement. – Adrian Nov 21 '14 at 13:20
  • First of all suspicion is not enough to give that Tag. 2. I don't think it is a bug. If you focus on the link I've given you will see that it is the way it is working. Axes which are not created with AxesEdge are different objects which will always be on top of 3D graphics...
  • – Kuba Nov 21 '14 at 14:10
  • ... and that is why I think it is a duplicate of my question. – Kuba Nov 21 '14 at 14:12
  • 2
    @Kuba, AxisOrigin doesn't create new axis, only shapes it, but as well it introduces this unproper and unexpected behaviour. It's not mentioned anyhow in docs, so it really looks like a bug – funnyp0ny Nov 21 '14 at 14:35
  • @Kuba actually, I now think this may well be a duplicate of that if there is no "TicksInFront" option - I just got a little ahead of myself as the code used was not given credit where credit was due... :) – gpap Nov 21 '14 at 16:01
  • 1
    @funnypony I think it's just the things appears to be. The answer under Kuba's question came from a WRI employee, thus is at least "semi-official". Actually I guess the appeared "axis" when using AxisOrigin or not using it are constructed from different base/origin. – Silvia Nov 22 '14 at 08:40