8000 Make tickdirs work all the time · matplotlib/matplotlib@4370ecf · GitHub
[go: up one dir, main page]

Skip to content

Commit 4370ecf

Browse files
Make tickdirs work all the time
More tickdir tweaks
1 parent 5d2c3f6 commit 4370ecf

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,22 @@ def _get_tickdir(self, position=None):
368368
"""
369369
# TODO: Move somewhere else where it's triggered less:
370370
tickdirs_base = [v["tickdir"] for v in self._AXINFO.values()] # default
371+
elev_mod = np.mod(self.axes.elev + 180, 360) - 180
372+
azim_mod = np.mod(self.axes.azim, 360)
371373
if position == 'upper':
372-
tickdirs_base = [2, 2, 0]
374+
if elev_mod >= 0:
375+
tickdirs_base = [2, 2, 0]
376+
else:
377+
tickdirs_base = [1, 0, 0]
378+
if (0 <= azim_mod < 180):
379+
tickdirs_base[2] = 1
373380
elif position == 'lower':
374-
tickdirs_base = [1, 0, 1]
381+
if elev_mod >= 0:
382+
tickdirs_base = [1, 0, 1]
383+
else:
384+
tickdirs_base = [2, 2, 1]
385+
if (0 <= azim_mod < 180):
386+
tickdirs_base[2] = 0
375387
info_i = [v["i"] for v in self._AXINFO.values()]
376388

377389
i = self._axinfo["i"]

0 commit comments

Comments
 (0)
0